In switch case if a condition contains a break that case is being executed than the switch case will terminate
switch ( inChar ) {
case 'A' : printf ("Choice A \ n");
WE CAN SEE HERE THAT there is no break statement inside case though in char is A
BT THIS STATEMENT WILL NOT TERMINATE as it doesnt contain break
here output will be Choice A
so now case B is being executed
case 'B'
here there is nothing inside so now case C will execute
case 'C' : printf ("Choice B");
noe case C will execute and Choice B is printed
ALSO POINT TO BE NOTED AS DUE TO /n IN case A the curser had moved to nct line
so “Choice B” will be executed in next line.
now case D will be executed
case 'D' :
it also doesnt contain any statement so now case E will execute
which also contain no statement
case 'E' :
so in last default will also execute
default : printf ("No Choice");
and No Choice will be printed .
AND THIS LEAD TO END OF SWITCH CASE AND HERE THERE WAS NO break statement so all cases got executed
SO FINAL OUTPUT WILL BE
Choice A
Choice B No Choice