Given this code fragment:
What is the output?
The value 5 does not match any case label (1, 2, 3, 4, 6, or 7, 9), so the default switch rule executes and prints Invalid grade.
5
1, 2, 3
4, 6
7, 9
default
Invalid grade.
Community Discussion