ProgrammingHardGATE CS · Campus placements

What does printf("%d", '0' < '9') print?

  1. A. 0
  2. B. 9
  3. C. 48
  4. D. 1

Correct answer: D. 1

The digit characters are guaranteed to be contiguous and increasing in every conforming character set, so '0' < '9' is true and prints 1.

More C Programming questions

Exams that ask this topic