Switch Statements in C++
Switch Statements in C++
Switch statements in C++ is used to select one of many code blocks to be executed. The switch statement in C++ executes one statement from multiple conditions. It is same as if-else-if ladder statement in C++
How Switch statements work?
Firstly, switch expression is evaluated for one time then the given value of expression is compared with the value of each case. If this value is match then block of code will be executed.And there are break and default keywords they are optional.
Read more, Loops in C++