- This is the second part of selection Statement. if -else we have already discussed in previous chapter 1 / Flow Control.
- If multiple options are available then it is not recommended to use nested if-else.To meet this requirement we should go for the switch ( ) Statement.
Syntax:-
switch ( x )
{
case 1: Action -1
break;
case 2: Action -2
break;
case 3: Action -3
break;
case 4: Action -4
break;
default : default Action
}