ProgrammingModerate

unsigned char c = 255; c++; printf("%d", c); What is printed?

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

Correct answer: A. 0

Incrementing an unsigned char past its maximum wraps to 0, which is well defined.

More C Programming questions

Exams that ask this topic