Hello and thank you for reading/responding.i keep geting this error on my IDE (dev C++) "duplicate label 'case 1'" i assume it is because I put a switch case in a switch case. is this legal? and if it is illegal how else can i write it to have the same effect? thank you for feed back!!!
1. It is case 1: not case1:. Leave space between the keyword and 1.
2. Avoid typographical error. Observe Line3. Change case1; to case 1:
3. Reformat your code to readable form
4. Use appropriate tags while posting.
int main()
{
int x = 0, y = 0, z = 0;
switch(x)
{
case 1:
switch(y)
{
case 1:
//code
break;
case 2:
//code
break;
case 3:
//code
break;
}
case 2:
switch(z)
{
case 1:
//code
break;
case 2:
//code
break;
case 3:
//code
break;
}
}
return 0;
}