find and solve || findandsolve.com
Please wait.....

C# Program For Getting a Month Name Using Month Number using array

int i; string[] months = new string[12] { "Jan ", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; Console.WriteLine("Enter the number from 1 to 12", months); for(i = 1; i<= 12; i++) { Console.WriteLine("Enter the months number", months[i]); i = Convert.ToInt32(Console.ReadLine()); } for (i = 1; i <= 12; i++) { Console.WriteLine("You entered the month number of {1}", months[i]); } if (i > 12) { Console.WriteLine("You entered the wrong number", months); } Console.ReadLine(); } } }

Comments



Report Response