ProgrammingVery hardGATE CS · Advanced

What is printed? Assume a C compiler where double is larger than float.

What is printed? Assume a C compiler where double is larger than float.
printf("%d %d %d", sizeof('a') == sizeof(int), sizeof(1.5f) == sizeof(float), sizeof(1.5) == sizeof(float));
  1. A. 0 1 0
  2. B. 1 0 0
  3. C. 1 1 1
  4. D. 1 1 0

Correct answer: D. 1 1 0

A character constant has type int in C, and 1.5f is a float; the unsuffixed 1.5 is a double, which is larger than float.

More C Programming questions

Exams that ask this topic