ProgrammingHard
With 32-bit unsigned int, what is 65536u * 65536u?
- A. 4294967296
- B. 0
- C. 1
- D. 65536
Correct answer: B. 0
The true product 2^32 wraps modulo 2^32 for unsigned arithmetic, so the result is 0.
More C Programming questions
- Exponentiation by squaring computes x^1000 with how many multiplications at most, counting squarings and the result multiplications?
- In ASCII, what is 'k' ^ 32 as a character?
- In a 32-bit unsigned int, what is (~0u) >> 28?
- What value does a[i] ^= a[j] leave when i and j refer to the same element?
- Which expression sets bit 31 of an unsigned 32-bit variable x with no undefined behaviour?
- The sequence n ^ (n >> 1) for n = 0, 1, 2, 3 gives what list?