The switch and case statement is used when a block of statements has to be executed among many blocks. For example:
switch(expression) { case '1': //some statements to execute when 1 break; case '5': //some statements to execute when 5 break; default: //some statements to execute when default; }