Answers for "switch 2 cases with the same result"

C#
0

switch 2 cases with the same result

switch (x)
{ 
    case 1:
    case 2:
        Console.WriteLine("x = 1 or x = 2");
        break;
    default:
        break;
}
Posted by: Guest on June-06-2021

C# Answers by Framework

Browse Popular Code Answers by Language