Which one of the choices given below would be printed when the following…
PYQ GATE 2006
Which one of the choices given below would be printed when the following program is executed?
#include<stdio.h>
int a1[] = {6, 7, 8, 18, 34, 67};
int a2[] = {23, 56, 28, 29};
int a3[] = {-12, 27, -31};
int *x[] = {a1, a2, a3};
void print(int *a[])
{
printf("%d,", a[0][2]);
printf("%d,", *a[2]);
printf("%d,", *++a[0]);
printf("%d,", *(++a)[0]);
printf("%d\n", a[-1][+1]);
}
main()
{
print(x);
}
- A.
8, -12, 7, 23, 8
- B.
8, 8, 7, 23, 7
- C.
-12, -12, 27, -31, 23
- D.
-12, -12, 27, -31, 56
Attempted by 220 students.
Sign up free to check your answer
Sign up freeLoading lesson…

