Advertisement
dsavov_02

switch days part2

Nov 23rd, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.53 KB | None | 0 0
  1. using System;
  2.                    
  3. public class Program
  4. {
  5.     public static void Main()
  6.     {
  7.         string day = Console.ReadLine();
  8.         switch (day)
  9.         {  
  10.             case "Monday": Console.WriteLine(1); break;
  11.             case "Tuesday": Console.WriteLine(2); break;
  12.             case "Wednesday": Console.WriteLine(3); break;
  13.             case "Thursday": Console.WriteLine(4); break;
  14.             case "Friday": Console.WriteLine(5); break;
  15.             case "Saturday": Console.WriteLine(6); break;
  16.             case "Sunday": Console.WriteLine(7); break;
  17.             default: Console.WriteLine("invalid input"); break;
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement