Answers for "type switch c#"

C#
2

c# switch example

switch (iGender)
            {
                case 1:
                    LabelOne.Text = "Male";
                    break;

                case 2:
                    LabelOne.Text = "Female";
                    break;
Posted by: Guest on February-03-2021
1

C# Switch

int var = 3;

switch (var)
{
  case 1:
    Console.WriteLine("Ahoy!");
	break;
  case 2:
    Console.WriteLine("Hi!");
    break;
  case 3:
    Console.WriteLine("HELLO!");
    break;
}

//Output: HELLO!
Posted by: Guest on November-23-2020

C# Answers by Framework

Browse Popular Code Answers by Language