Understanding C++ case statements and control flow
This is an easy C++ question that tests your grasp of how switch statements execute and the role of the break keyword. It is the second in a two-part series designed to build fluency with a common source of bugs in control flow.
To answer correctly, you need to trace through the code carefully, paying attention to which branch the switch enters and whether execution continues past that point. The question rewards precise knowledge of C++ semantics over guessing or relying on intuition about what "should" happen.
- Switch statement structure and label matching
- Fall-through behaviour without break
- Execution order and program counter movement