ProgrammingModerateTCS NQT · Infosys

unsigned int n = 1u; unsigned int r = n << 31; What is r?

  1. A. 2147483648
  2. B. 0
  3. C. 1
  4. D. 4294967296

Correct answer: A. 2147483648

The shift count 31 is less than the 32-bit width, so the shift is defined and sets bit 31, which is 2147483648.

More C Programming questions

Exams that ask this topic