C program is given below: # include <stdio.h> int main () { int i, j; char a…
GATE · 2008 · IT
C program is given below:
# include <stdio.h>
int main ()
{
int i, j;
char a [2] [3] = {{'a', 'b', 'c'}, {'d', 'e', 'f'}};
char b [3] [2];
char *p = *b;
for (i = 0; i < 2; i++) {
for (j = 0; j < 3; j++) {
*(p + 2*j + i) = a [i] [j];
}
}
}What should be the contents of the array b at the end of the program?
- A.
a b
c d
e f
- B.
a d
b e
c f
- C.
a c
e b
d f
- D.
a e
d c
b f
Attempted by 70 students.
Sign up free to check your answer
Sign up freeLoading lesson…