Having trouble writting my program

Can you write an if/ else statement inside a switch statement? And if so can you show me how it should be written?
yes.
1
2
3
4
5
6
7
8
9
10
11
12
13
switch(variable)
{
    case 1:
        if(x > y)
            //do something
        else
            //do another
         break;
    
    case 2:
    //......
    default:
 }
Last edited on
Thanks that really helped.
Topic archived. No new replies allowed.