RosettaCodeData/Task/Conditional-structures/C-sharp/conditional-structures-3.cs

14 lines
243 B
C#

switch (value)
{
case 1:
// Some task
break; // Breaks are required in C#.
case 2:
case 3:
// Some task
break;
default: // If no other case is matched.
// Some task
break;
}