The switch is a multiway branch. It controls a block containing a sequence of case statements that mark entry points to the block with an integral value. The switch operand is evaluate and control passes to case statement of equal value.
A default: case exists which is the entry point of the block when no case matches the operand value.
It is a common error to assume that the case statements mark ending points as well as entry points to the block. Usually break statements are required to get the desired behavior. more ...
LiveC: An example of if/else, and an exercise in nested loops. more ...