C Language - Input/Output Questions and Answers

Practice Mode
Showing 10 of 54 questions
Q51
 What will be the result of executing the following statement ? int i = 10 printf ( "%d %d %d", i, ++i, i++);
  • A 10 11 12
  • B 10 11 11
  • C result is operating system dependent
  • D result is compiler dependent
Answer: Option D
Q52
 What will be the result of the following program if the inputs are 2 3 ? main ( ) { int a, b; printf ("enter two numbers :"); scanf ("%d%d',a,b); printf('%d+%d=%d', a,b, a+b); }
  • A 2+3=5
  • B syntax error
  • C will generate run time error/core dump
  • D a + b = 5
Answer: Option C
Q53
 main ( ) { int a=10, b=5, c=3, d=3; if ((a<b) && (c = d++)) printf ("%d %d %d", a,b,c,d); else printf ("%d %d %d %d", a, b, c, d); }
  • A 10 5 3 4
  • B 10 5 4 4
  • C 10 5 3 3
  • D none of the above
Answer: Option C
Q54
 What is the output off the following statement ? printf("%u", -1);
  • A -1
  • B minimum int value
  • C maximum int value error
  • D error
Answer: Option C
Questions and Answers for Competitive Exams Various Entrance Test