Console Program for display name of Day when user input integer value using Switch Case.
using System;
namespace code
{
class switchCase
{
public static void Main(string[] args)
{
string i;
Console.WriteLine("Enter Number Of Day");
i=(Console.ReadLine());
switch (i)
{
case "1":
{
Console.WriteLine("SUNDAY");
break;
}
case "2":
{
Console.WriteLine("MONDAY");
break;
}
case "3":
{
Console.WriteLine("TUESDAY");
break;
}
case "4":
{
Console.WriteLine("WEDNESDAY");
break;
}
case "5":
{
Console.WriteLine("THURSDAY");
break;
}
case "6":
{
Console.WriteLine("FRIDAY");
break;
}
case "7":
{
Console.WriteLine("SATURDAY");
break;
}
default:
{
Console.WriteLine("WRONG INPUT");
break;
}
}
}
}
}
No comments:
Post a Comment