What is switch statement explain with example
switch statement
Useful when a variable or expression is tested for all the values it can assume and different actions are taken
Format
Series of case labels and an optional default case
switch ( value ){
case '1':
actions
case '2':
actions
default:
actions
}
break; exits from structure