In this I will show you switch statement syntax with example.
C#.Net
int caseValue = 1;
switch (caseValue) {
case 1:
Console.WriteLine("case 1");
break;
case 2:
Console.WriteLine("case 2");
break;
default:
Console.WriteLine("default case");
break;
} VB.Net
Dim caseValue As Integer = 1
Select Case caseValue
Case 1
Console.WriteLine("case 1")
Case 2
Console.WriteLine("case 2")
Case Else
Console.WriteLine("default case")
End Select
In above code I have taken a variable of integer type. Now as per variable value we are displaying the message. Now run the code to check the output.