Switch Statement in C
The switch statement in C is an alternate to if-else-if ladder statement which allows us to execute multiple operations for the different possibles values of a single variable called switch variable. Here, We can define various statements in the multiple cases for the different values of a single variable. The syntax of switch statement in c language is given below: switch (expression){ case value1: //code to be executed; break ; //optional case value2: //code to be executed; break ; //optional ...... default : code to be executed if all cases are not matched; } ...