ProgrammingVery hard

printf("%d", -1 < 1u); What is printed?

  1. A. 0
  2. B. 1
  3. C. 2
  4. D. undefined behaviour

Correct answer: A. 0

The -1 is converted to unsigned int, which is larger than 1, so the comparison is false.

More C Programming questions

Exams that ask this topic