

It has the following format :

switch(expression)

{

case value1:
block1
break;
case value2:
block2

break;

———

default:

block


break;

} The break statement used at the end of each case acts as an exit point from the


switch statement. It works as a jumping statement and the execution is transferred

to the statement following the switch statement. The Default statement is the

executing condition in the condition when the value of switch does not match with

the case. It does not require any usage of break as it is always the last segment of
the switch structure.





attention@computerscienceexpertise.com



















