edited by
26,884 views
100 votes
100 votes

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);
}
  1. $\text{jungle, n, 8, nclastor}$
  2. $\text{etter, u, 6, ungle}$
  3. $\text{cetter, k, 6, jungle}$
  4. $\text{etter, u, 8, ncestor}$
edited by

6 Answers

4 votes
4 votes

Ans is option b

3 votes
3 votes
answer is :

option B

etter,u,6,ungle
Answer:

Related questions

42 votes
42 votes
9 answers
4