Switch and cases in c code example
Example 1: c switch
int i;
switch (i){
case 1:
//The Proccess you want to be executed
break;
case 2:
//The Proccess you want to be executed
break;
default:
break;
}
Example 2: switch case in c syntax
switch( expression )
{
case value-1:
Block-1;
Break;
case value-2:
Block-2;
Break;
case value-n:
Block-n;
Break;
default:
Block-1;
Break;
}
Statement-x;