ProgrammingHardGATE CS · Campus placements

uint32_t p = 65536u * 65536u; What is p?

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

Correct answer: C. 0

The true product 2^32 does not fit in 32 bits. Unsigned multiplication reduces modulo 2^32, so p becomes 0. The operation is well defined and no overflow trap occurs.

More C Programming questions

Exams that ask this topic