ProgrammingHard

What is the value of (unsigned short)(65535 + 1) on a platform where unsigned short is 16 bits?

  1. A. 0
  2. B. 65536
  3. C. 65535
  4. D. 1

Correct answer: A. 0

65536 is converted to unsigned short by taking the value modulo 65536, which is 0.

More C Programming questions

Exams that ask this topic