C# using objects as expressions in switch cases code example
Example 1: c# switch case with or condition
int i = 5;
switch (i)
{
case(1):
case(2):
Console.WriteLine(i);
break;
default:
break;
}
Example 2: c# switch example
switch (iGender)
{
case 1:
LabelOne.Text = "Male";
break;
case 2:
LabelOne.Text = "Female";
break;