NadyaMisheva

switch - default

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