C Data Types 2 Questions and Answers

Practice Mode
Showing 10 of 159 questions
Q101
Find the output void main ( ) { enum values (x, y, z); printf (%d %d %d", x++, y++, ++z); }
  • A 0 1 2
  • B 0 1 3
  • C 1 2 3
  • D Compilation error
Answer: Option D
Q102
The synonym for an existing data type can be created using
  • A typedef
  • B structure
  • C enum
  • D All of the above
Answer: Option A
Q103
Find the output void main ( ) { int x=345, r, sum=0, i; if x!=0) { r=x%10; sum+=r; i=i/10; } printf ("%d", sum); }
  • A 5
  • B 12
  • C Compilation error
  • D None of these
Answer: Option A
Q104
Find the output void main ( ) { int x=-300; unsigned char *p; p=&x; printf ("%d", *p++); printf("%d", *p); }
  • A 212 88
  • B 212 254
  • C 128 172
  • D None of these
Answer: Option B
Q105
Find the output void main ( ) { float f; f=5/2; printf("%F %f", f, 5/2); }
  • A 2.5000 2.5000
  • B 2.0000 2.0000
  • C 2.0000 Garbage value
  • D Both outputs have garbage values
Answer: Option C
Q106
Find the output void main ( ) { int p=7, q=9; p=p^q; q=q^p; printf("%d %d", p,q); }
  • A 7 9
  • B 9 7
  • C 18 9
  • D 14 7
Answer: Option D
Q107
Find the output void main ( ) { int x=65536, y; y=sizeof (++x); printf("%d %d', x,y); }
  • A 0 2
  • B 1 2
  • C 65536 2
  • D None of these
Answer: Option A
Q108
Find the output void main ( ) { long i=60000+5536; printf("%d->%d", i) }
  • A 65536->0
  • B 65536-1
  • C 0->1
  • D 1->0
Answer: Option C
Q109
Find the output void main ( ) { printf("%d', sizeof (!5.0)); }
  • A 5
  • B 2
  • C 8
  • D 4
Answer: Option B
Q110
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
Questions and Answers for Competitive Exams Various Entrance Test