Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

switch c#

//EXAMPLE
int day = 4;
switch (day) 
{
  case 1:
    Console.WriteLine("Monday");
    break;
  case 2:
    Console.WriteLine("Tuesday");
    break;
  case 3:
    Console.WriteLine("Wednesday");
    break;
  case 4:
    Console.WriteLine("Thursday");
    break;
  case 5:
    Console.WriteLine("Friday");
    break;
  case 6:
    Console.WriteLine("Saturday");
    break;
default:
    Console.WriteLine("Sunday");
break;
}
Source by www.c-sharpcorner.com #
 
PREVIOUS NEXT
Tagged: #switch
ADD COMMENT
Topic
Name
1+4 =