24
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
string msg = "selected one";
12
Console.WriteLine($"Hello World :{msg}");
13
break;
14
case 2:
15
msg = "selected two";
16
Console.WriteLine($"Hello World :{msg}");
17
break;
18
default:
19
msg = "nothing selected.so default";
20
Console.WriteLine($"Hello World :{msg}");
21
break;
22
}
23
}
24
}
Cached Result