DEV Community

Ivan Ivanov
Ivan Ivanov

Posted on

1. Day of Week (Switch Construction)

using System;

namespace DayOfWeek
{
internal class Program
{
    static void Main(string[] args)
    {
        int dayOfWeek = int.Parse(Console.ReadLine());

        switch (dayOfWeek)
        {
            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;

            case 7:
                Console.WriteLine("Sunday");
                break;

            default:
                Console.WriteLine("Error");
                break;
        }
    }
}
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)