Using Switch Statement in C Programming for Microcontrollers
The C language also provides another way for multi-branch selection using the switch statement, which has the general form:switch(expression){ case constant_expression1: statement1; case constant_expression2: statement2; … case constant_expressionn: statementn; default: statementn+1;}The semantics are: calculate the value of the expression. Then compare it one by one with the subsequent constant expression values. When the value of … Read more