39
1
using System;
2
3
public class NestedSwitchCaseProgram
4
{
5
public static void Main()
6
{
7
int MainVal = 5;
8
9
switch (MainVal)
10
{
11
case 5:
12
Console.WriteLine(5);
13
//another siwtch
14
switch (MainVal - 1)
15
{
16
case 4:
17
Console.WriteLine(4);
18
// third switch case
19
switch (MainVal - 2)
20
{
21
case 3:
22
Console.WriteLine(3);
23
break;
24
}
25
break;
26
}
27
break;
28
case 8:
29
Console.WriteLine(8);
30
break;
31
case 9:
32
Console.WriteLine(9);
33
break;
34
default:
35
Console.WriteLine(100);
36
break;
37
}
38
}
39
}
Cached Result