Switch statement
We have seen that when we have many alternatives and we have to select one of them, we can use an if statement to control the selection. However, the complexity of such a program increases dramatically when number of alternatives increases. To, come out from these situations C has a built-in multiway decision statement known as "switch" . It tests the value of a given variable or expression against a list of case values and when a match is found, a block of statements associated with that case is executed. The general form of a switch statement is:- "switch(expression) { case value 1: block 1 break; case value 2: block 2 break; case value 3: block ...