Getting day of week
//sunday monday
Console.WriteLine("Enter series to get weekday");
int a = int.Parse(Console.ReadLine());
switch (a)
{
case 1:
Console.WriteLine("Sunday");
break;
case 2:
Console.WriteLine("Monday");
break;
case 3:
Console.WriteLine("Tuesday");
break;
case 4:
Console.WriteLine("Wednesnday");
break;
case 5:
Console.WriteLine("Thursday");
break;
case 6:
Console.WriteLine("Friday");
break;
case 7:
Console.WriteLine("Saturday");
break;
default:
Console.WriteLine("Enter value 1 to 7 only");
break;
}
Console.ReadLine();
No comments:
Post a Comment