ProgrammingHard
printf("%d", (2, 3) | 4); What is printed?
- A. 7
- B. 3
- C. 4
- D. 6
Correct answer: A. 7
The comma operator yields its right operand, 3, and 3 | 4 = 7.
More C Programming questions
- printf("%lld", (3LL 1000000007 + 5) % 1000000007); What is printed?
- 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?