switch statement:
Syntax :
switch(value/variable/expression)
{
case value1 : statements
break;
case value2 : statements
break;
'
'
'
default :
statements
}
A switch statement allows a variable to be tested for equality against a list of values. Each value is called a case, and the variable being switched on is checked for each switch case.
Comments
Post a Comment