switch (integer-producing expression) { case integer constant 1: statements for integer 1 break; case integer constant 2: statements for integer 2 break; ... default: default statements }
switch
statements, you may omit the symbol
default:
and the default statements.
switch
statements,
the integer-producing expression can produce a value belonging to any of
the integral data types.
switch
statements, once embedded statement execution begins,
execution continues up to the first embedded break
statement or
the end of the switch
statement, whichever comes first.
Bugs emerge when you forget to pair case
symbols with break
statements.
#include... exit (0);