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>
struct test {
int i;
char *c;
}st[] = {5, "become", 4, "better", 6, "jungle", 8, "ancestor", 7, "brother"};
main ()
{
struct test *p = st;
p += 1;
++p -> c;
printf("%s,", p++ -> c);
printf("%c,", *++p -> c);
printf("%d,", p[0].i);
printf("%s \\n", p -> c);
}
- A.
jungle, n, 8, ncestor
- B.
etter, u, 6, ungle
- C.
cetter, k, 6, jungle
- D.
etter, u, 8, ncestor
Attempted by 199 students.
Sign up free to check your answer
Sign up freeLoading lesson…

