ProgrammingVery hard

unsigned int a = 3, b = 5; printf("%u", a - b + 3); What is printed on a 32-bit platform?

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

Correct answer: D. 1

3 - 5 wraps to 4294967294 in unsigned arithmetic, and adding 3 wraps again to 1.

More C Programming questions

Exams that ask this topic