ProgrammingHard

printf("%u", (~0u) / 2 + 1); What is printed with a 32-bit unsigned int?

  1. A. 2147483647
  2. B. 2147483648
  3. C. 4294967295
  4. D. 0

Correct answer: B. 2147483648

~0u is 4294967295, whose half is 2147483647, and adding 1 gives 2147483648.

More C Programming questions

Exams that ask this topic