Answers for "c# switch expression and"

C#
0

c# switch

public static void Main()
   {
      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;
      }
   }
// The example displays the following output:
//       Case 1
Posted by: Guest on February-11-2021

C# Answers by Framework

Browse Popular Code Answers by Language