The switch statement causes a particular group of statements to be chosen from several available groups. The selection is based upon the current value of an expression that is in- cluded within the switch statement. The form of switch statement is.
switch (integer expression)
{
case constant 1:
do this;
break;
case constant 2:
do this;
break;
case constant 3:
do this;
default;
do this;
}
switch (integer expression)
{
case constant 1:
do this;
break;
case constant 2:
do this;
break;
case constant 3:
do this;
default;
do this;
}