ProgrammingModerateGATE CS · Campus placements

What does printf("%d", sizeof(int) > sizeof(char)) print?

  1. A. 1
  2. B. 0
  3. C. sizeof(int)
  4. D. compile error

Correct answer: A. 1

sizeof(char) is always 1 and sizeof(int) is at least 2 in C, so the comparison is true and prints 1.

More C Programming questions

Exams that ask this topic