Answers for "c# swtich"

C
1

c# swtich

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 February-23-2021
0

c# swtich

int i = 1;

switch(i)
{
    case 1:
    {
        Console.WriteLine("1");
        break;
    }
    case 2:
    {
        Console.WriteLine("2");
        break;
    }
    case 3:
    {
        Console.WriteLine("3");
        break;
    }
    default:
    {
        Console.WriteLine("default");
        break;
    }
}
Posted by: Guest on August-26-2021

Code answers related to "C"

Browse Popular Code Answers by Language