Difficulty: Medium
Correct Answer: case D | case d
Explanation:
Introduction / Context:
This tests understanding of bitwise OR on character codes and how a switch with grouped cases routes execution to a specific write line.
Given Data / Assumptions:
Concept / Approach:
Bitwise OR combines set bits. Since 97|98 == 99, and 99|99 == 99, the result is 'c'. The switch has a group that includes 'C'/'c' and also routes to a print line labeled "case D | case d".
Step-by-Step Solution:
Verification / Alternative check:
Write hex: 0x61 | 0x62 = 0x63; 0x63 | 0x63 = 0x63; 0x63 corresponds to 'c'.
Why Other Options Are Wrong:
Common Pitfalls:
Assuming grouped cases must print their own letter; in this example, the author intentionally prints the string mentioning D for multiple labels.
Final Answer:
case D | case d
Discussion & Comments