ProgrammingVery hard
What is printed by printf("%d", 7 * 13 % 5 * 3 % 4);?
- A. 1
- B. 3
- C. 2
- D. 0
Correct answer: B. 3
The operators * and % have equal precedence and group left to right: 91 % 5 = 1, times 3 is 3, and 3 % 4 = 3.
More C Programming questions
- In C99, what are the values of -8 % 3 and 8 % -3?
- What is 2^62 mod 1000000007?
- What is the total number of 1 bits in the binary representations of the integers 1 through 10?
- What is 1 ^ 2 ^ 3 ^ 4 ^ 5 ^ 6 ^ 7 ^ 8 ^ 9 ^ 10 in C?
- What is the Hamming distance between 13 and 22 (the number of bit positions where they differ)?
- unsigned int a = 3, b = 5; printf("%u", a - b + 3); What is printed on a 32-bit platform?