C Data Types 2 Questions and Answers

Practice Mode
Showing 10 of 159 questions
Q21
Which of the following is a valid character constant.
  • A '5'
  • B '\5'
  • C '\x5'
  • D All the above
Answer: Option D
Q22
When a type modifer is used by itself then it is assumped to be a type
  • A char
  • B float
  • C int void
Answer: Option C
Q23
What is the format specifier of long double ?
  • A % Id
  • B % Id
  • C % If
  • D % g
Answer: Option C
Q24
Find the output 'void main ( ) { printf ("%d", (long double *) 200+1); }
  • A 208
  • B 210
  • C 212
  • D Depends on compiler
Answer: Option D
Q25
Find the output void main ( ) { printf ("%%d", 5); }
  • A 5
  • B %5
  • C %d
  • D None of these
Answer: Option C
Q26
Find the output. void main ( ) { char x=-130; char y=-5; printf ("%i", x+y); }
  • A -135
  • B -3
  • C 7
  • D 121
Answer: Option D
Q27
In a 16-bit O.S. every negative integer is stored in memory in the form of
  • A 2's complement of 16 data bits.
  • B 2's complement of 15 data bits.
  • C 1's complement of 16 data bits.
  • D None of these
Answer: Option A
Q28
Find the output void main ( ) { unsigned int x=500; int y=-5; if (x>y); printf ("hello"); else printf ("hi"); }
  • A hi
  • B hello
  • C compilation error
  • D None of these
Answer: Option A
Q29
Find the output void main ( ) { double y=2.4; float x=(float) y; printf ("%d%d", sizeof (x), sizeof (y)); }
  • A 4 4
  • B 4 8
  • C 8 8
  • D None of these
Answer: Option B
Q30
Find the output void man ( ) { unsigned char x=200; char y=140; printf (%d", x+y); }
  • A 213
  • B 84
  • C -84
  • D No output
Answer: Option B
Questions and Answers for Competitive Exams Various Entrance Test