Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace DaysInWeekWithArrays
- {
- class DaysInWeekwithArrays
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- Week(n);
- }
- public static int Week(int n)
- {
- string[] WeekDays = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" };
- if (n >= 1 && n <= 7)
- {
- string d = WeekDays[n - 1];
- Console.WriteLine(d);
- }
- else
- {
- Console.WriteLine("Invalid Day");
- }
- return n;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment