how to use switch statement c++ code example
Example 1: c++ switch case statement
switch (n)
{
case 1:
break;
case 2:
break;
default:
}
Example 2: switch statement c++
switch(expression) {
case constant-expression :
statement(s);
break;
case constant-expression :
statement(s);
break;
default :
statement(s);
}
Example 3: switch case sinax c++
switch (<espressione>)
{
case <valore costante 1>:
break;
case <valore costante 2>:
break;
...
case <valore costante N>:
break;
default:
break;
}
Example 4: c++ switch case
switch(expr) {
case 1:
break;
case 2:
break;
default:
}