Answers for "using switch case in c#"

C#
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

Code answers related to "using switch case in c#"

C# Answers by Framework

Browse Popular Code Answers by Language