Switch in C Language tccicomputercoaching.com What is Switch? Switch is used to select any one from multiple choice. The switch statement allows us to execute one code block among many alternatives.
A switch statement tests the value of a choice variable and compares it with multiple cases. Once the case match is found, a block of statements associated with that particular case is executed. Each case in a block of a switch has a different name/number which is referred to as an identifier. Syntax: switch(variable) { case lable1: statement: break; case lable2: statement: