ProgrammingVery hardGATE CS · Campus placements

uint32_t x = 0u; x -= 1; x = x / 2 + 1; What is x?

  1. A. 4294967295
  2. B. 2147483647
  3. C. 2147483649
  4. D. 2147483648

Correct answer: D. 2147483648

x wraps to 4294967295, and dividing by 2 gives 2147483647. Adding 1 produces 2147483648.

More C Programming questions

Exams that ask this topic