Rob Adams
0
Q:

switch case sinax c++

switch (n)
{
    case 1: // code to be executed if n = 1;
        break;
    case 2: // code to be executed if n = 2;
        break;
    default: // code to be executed if n doesn't match any cases
}
11
switch (<espressione>)
{
case <valore costante 1>:
// istruzioni
break;


case <valore costante 2>:
// istruzioni
break;
...
case <valore costante N>:
// istruzioni
break;
default:
// istruzioni
break;
}
0

New to Communities?

Join the community