ProgrammingModerate

What is printed by printf("%d", 0x7FFFFFFF + 0);?

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

Correct answer: C. 2147483647

Adding zero cannot overflow, so the value is INT_MAX, 2147483647.

More C Programming questions

Exams that ask this topic