ProgrammingHardTCS NQT · Infosys
uint64_t big = (uint64_t)0xFFFFFFFF * 2; What is big?
- A. 8589934590
- B. 4294967294
- C. 0
- 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
- enum { A, B = 5, C }; What is the value of C?
- How many integers from 1 to 100 are divisible by 3 or by 5?
- How many two-digit decimal numbers have digits summing to 9?
- The sorted array is {1, 3, 5, 7, 7, 9}. What is the index of the first element greater than 7?
- int n = 0; reading the expression as C does: What is the value of ~5 + 1?
- int n = 0; while (n++ < 3) ; What is n after the loop?