ProgrammingHard

unsigned char a = 200, b = 100; unsigned char c = a + b; printf("%d", c); What is printed?

  1. A. 44
  2. B. 300
  3. C. 256
  4. D. -56

Correct answer: A. 44

a + b is computed as int, 300, and the store into an unsigned char keeps only the low 8 bits: 300 mod 256 = 44.

More C Programming questions

Exams that ask this topic