Answers for "c# type switch"

C#
1

c# switch

int caseSwitch = 1;

switch (caseSwitch)
{
  case 1:
    Console.WriteLine("Case 1");
    break;
  case 2:
    Console.WriteLine("Case 2");
    break;
  default:
    Console.WriteLine("Default case");
    break;
}
Posted by: Guest on July-11-2021
3

switch c#

var caseSwitch = 1;
switch (caseSwitch)
  {
    case 1:
      Console.WriteLine("Case 1");
      break;
    case 2:
      Console.WriteLine("Case 2");
      break;
    default:
      Console.WriteLine("Default case");
      break;
  }
Posted by: Guest on January-26-2021
0

c# switch

int caseSwitch = 1;	
switch (caseSwitch)
      {
          case 1:
              Console.WriteLine("Case 1");
              break;
          case 2:
              Console.WriteLine("Case 2");
              break;
          default:
              Console.WriteLine("Default case");
              break;
      }
Posted by: Guest on November-24-2020
0

switch c#

int something = 2;

switch(something)
{
  case 1:
    Console.WriteLine(1);
    break;
  case 2:
    Console.WriteLine(2);
    break;
}
Posted by: Guest on April-21-2021
0

c# switch

int month = 3;
switch(month) 
{
    case 1:
        Console.WriteLine("January");
        break;
    case 2:
        Console.WriteLine("February");
        break;
    case 3:
        Console.WriteLine("March");
        break;
    default:
        Console.WriteLine("No match found");
        break;
}
Posted by: Guest on July-13-2021

C# Answers by Framework

Browse Popular Code Answers by Language