1.

What will be the output of the program ? #include int main() { static int a[2][2] = {1, 2, 3, 4}; int i, j; static int *p[] = {(int*)a, (int*)a+1, (int*)a+2}; for(i=0; i<2; i++) { for(j=0; j<2; j++) { printf("%d, %d, %d, %d\n", *(*(p+i)+j), *(*(j+p)+i), *(*(i+p)+j), *(*(p+j)+i)); } } return 0; }

A. 1, 1, 1, 12, 3, 2, 33, 2, 3, 24, 4, 4, 4
B. 1, 2, 1, 22, 3, 2, 33, 4, 3, 44, 2, 4, 2
C. 1, 1, 1, 12, 2, 2, 22, 2, 2, 23, 3, 3, 3
D. 1, 2, 3, 42, 3, 4, 13, 4, 1, 24, 1, 2, 3
Answer» D. 1, 2, 3, 42, 3, 4, 13, 4, 1, 24, 1, 2, 3


Discussion

No Comment Found