32
1
using System;
2
3
public class Program
4
{
5
public static void Main()
6
{
7
int option = 2;
8
switch (option)
9
{
10
case 1:
11
{
12
string msg = "selected one";
13
Console.WriteLine($"Hello World :{msg}");
14
break;
15
}
16
17
case 2:
18
{
19
string msg = "selected two";
20
Console.WriteLine($"Hello World :{msg}");
21
break;
22
}
23
24
default:
25
{
26
string msg = "nothing selected.so default";
27
Console.WriteLine($"Hello World :{msg}");
28
break;
29
}
30
}
31
}
32
}
Cached Result