ProgrammingHardTCS NQT · Infosys

uint64_t big = (uint64_t)0xFFFFFFFF * 2; What is big?

  1. A. 8589934590
  2. B. 4294967294
  3. C. 0
  4. D. -2

Correct answer: A. 8589934590

The cast to uint64_t makes the multiplication 64-bit, so the product 8589934590 fits without wrapping. Without the cast the 32-bit product would wrap.

More C Programming questions

Exams that ask this topic