ProgrammingHard
printf("%lld", (3LL * 1000000007 + 5) % 1000000007); What is printed?
- A. 3
- B. 5
- C. 1000000007
- D. 0
Correct answer: B. 5
3 x (10^9 + 7) is a multiple of the modulus, so only the 5 remains.
More C Programming questions
- printf("%d", (1u << 31) / 2); What is printed with a 32-bit unsigned int?
- printf("%d", (unsigned short)70000); What is printed with a 16-bit unsigned short?
- printf("%d", 0xFF >> 1 & 0x0F); What is printed?
- printf("%u", (~0u) / 2 + 1); What is printed with a 32-bit unsigned int?
- printf("%d", ((1u << 4) - 1) ^ 0xF); What is printed?
- printf("%d %d", 7 / 2 2, 7 / (2 2)); What is printed?