Sail E0 Webinar

MCQs

Total Questions : 209 | Page 3 of 21 pages
Question 21. Determine Output:void main(){ char *p; p="Hello"; printf("%c", *&*p);}
  1.    None of These
  2.    Some Address will be printed
  3.    Hello
  4.    H
 Discuss Question
Answer: Option D. -> H
Question 22. Determine Output:void main(){ int i; printf("%d", scanf("%d", &i)); // value 10 is given as input here}
  1.    None of These
  2.    Garbage Value
  3.    10
  4.    1
 Discuss Question
Answer: Option D. -> 1
Question 23. Determine Output:void main(){ int i=0; for(;i++;printf("%d", i)); printf("%d", i);}
  1.    Error
  2.    1
  3.    11
  4.    12
 Discuss Question
Answer: Option B. -> 1
Question 24. Determine Output:void main(){ int i=1, j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; }}
  1.    None of These
  2.    GOOD
  3.    Compiler Error
  4.    GOOD BAD
 Discuss Question
Answer: Option C. -> Compiler Error
Question 25. Determine Output:void main(){ int i=1; while(i2) goto here; i++; }}fun(){ here: printf("PP");}
  1.    12PP
  2.    Compiler Error
  3.    None of These
  4.    12PP345
 Discuss Question
Answer: Option B. -> Compiler Error
Question 26. Determine output:void main(){ extern int i; i=20; printf("%d", sizeof(i));}
  1.    Linker Error
  2.    20
  3.    2
  4.    Compiler Error
 Discuss Question
Answer: Option A. -> Linker Error
Question 27. Determine Output:void main(){ struct xx { int x=3; char name[] = "hello"; }; struct xx *s = malloc(sizeof(struct xx)); printf("%d", s->x); printf("%s", s->name); }
  1.    Linking error
  2.    None of these
  3.    Compiler Error
  4.    3 hello
 Discuss Question
Answer: Option C. -> Compiler Error
Question 28. Determine Output:void main(){ int i=0, j=0; if(i && j++) printf("%d..%d", i++, j); printf("%d..%d", i, j);}
  1.    1..0
  2.    0..1
  3.    1..1
  4.    0..0
 Discuss Question
Answer: Option D. -> 0..0
Question 29. Determine Output:void main(){ static int i=5; if(--i){ main(); printf("%d ", i); }}
  1.    Infinite Loop
  2.    5 4 3 2 1
  3.    0 0 0 0
  4.    None of These
 Discuss Question
Answer: Option C. -> 0 0 0 0
Question 30. Determine Output:void main(){ int i=-1, j=-1, k=0, l=2, m; m = i++ && j++ && k++ || l++; printf("%d %d %d %d %d", i, j, k, l, m);}
  1.    0 0 1 3 0
  2.    0 0 1 2 0
  3.    0 0 0 2 1
  4.    0 0 1 3 1
 Discuss Question
Answer: Option D. -> 0 0 1 3 1

Latest Videos

Latest Test Papers