C Data Types 2 Questions and Answers

Practice Mode
Showing 10 of 159 questions
Q111
Find the output. void main ( ) char i=1; for (i;i<127;i++) printf("Fll1"); }
  • A Prints Fool 127 times
  • B Prints Fool 126 times
  • C Prints Fool infinite times
  • D None of these
Answer: Option B
Q112
Find the output void main ( ) int x=32768; printf (%d %u", x, x); }
  • A -32768 32768
  • B 0 0
  • C 0 32768
  • D None of these
Answer: Option A
Q113
Find the output void main ( ) { unsigned int a=6; ~a; printf("%u", a); }
  • A 6
  • B 65529
  • C 65528
  • D 7
Answer: Option A
Q114
Find the output void main ( ) { int ch=48; if (ch) { printf("valid"); break; printf("ok") } else printf ("invalid"); }
  • A valid
  • B invalid
  • C No output
  • D Compilation error
Answer: Option D
Q115
Find the output. void main ( ) { int a:15; char b:7; printf("%d %d", sizeof (a), sizeof (b)); }
  • A 2 1
  • B 2 2
  • C 2 0
  • D Compilation error
Answer: Option D
Q116
Find the output void main ( ) { const int x=get( ); printf ("%d", x); } get ( ) { return (20); }
  • A 20
  • B 0
  • C Compilation error
  • D Garbage value
Answer: Option A
Q117
Find the output void main ( ) { printf ("%d %d", 85000); }
  • A 19464 0
  • B 19464 1
  • C 19464 garbage
  • D None of these
Answer: Option B
Q118
Find the output typedef struct boy { float height; char name;9; int age:16; } boy; void main ( ) { boy b={5 . 8, "Praveen kumar", 24}; printf("%f %s %d", b. height, b.name, b.age}; }
  • A 5.8 Praveen k24
  • B 5.8 Praveen kumar 24
  • C 5.8 Praveen k 16
  • D Compilation error
Answer: Option D
Q119
State the correct statement about external variables. (a) . (b) (c) (d)
  • A During declaration memory is allocated for external variables
  • B An external variable can be defined more than once.
  • C if a definition doesn't contain an initializer it is
  • D All of the above.
Answer: Option C
Q120
Find the output void main ( ) { int a; char b; float c; printer (%d", sizeof (a+b+c)); }
  • A 2
  • B 1
  • C 4
  • D 7
Answer: Option C
Questions and Answers for Competitive Exams Various Entrance Test