A case statement uses a switch expression to choose among several execution paths. It is especially useful when a cascade of if-else statements would be tedious. section 3.0 section 3.3
The switch expression determines the jump target. Each case and default label marks a target; execution continues from the selected label until break or the end of the block. section 3.3
TAKEAWAY: break terminates the enclosing switch and transfers control to the following statement. Without it, execution falls through into subsequent cases. section 3.3 section 3.4
Keep these language rules in view:
- Use case values that are integer constant expressions, such as fixed values written directly in the source. section 3.3
- Do not use variables as individual case values; variables belong in the switch expression. section 3.3
- Use default for values matching no case label. section 3.3
Intentional fallthrough
A switch on count can begin at case 3 and run the statements for cases 3, 2, 1, and 0 when no break statements intervene, producing progressively shorter output.








