ProgrammingHard

unsigned char c = 0; c -= 1; printf("%d", c); What is printed?

  1. A. 255
  2. B. 0
  3. C. -1
  4. D. 256

Correct answer: A. 255

Unsigned arithmetic wraps modulo 256 for unsigned char, so 0 - 1 becomes 255.

More C Programming questions

Exams that ask this topic