I am a beginning programmer. I am looking for an iteration loop so that I can continue to enter the month number and keep the program running.
I am a beginning programmer. I am looking for an iteration loop so that I can continue to enter the month number
and keep the program running. This is what I have so far in C# visual studio. if you run this it allows for one input and then shuts the program down. What am I missing?
static void Main(string[] args)
{
//declare variables
int month = 0;
Console.Write(“Enter the Number of the Month: “);
month = Convert.ToInt32(Console.ReadLine());
if (month == 1)
{
Console.WriteLine(“January is the first month of the Year”);
}
else if (month == 2)
{
Console.WriteLine(“February is the second month of the year”);
}
else if (month == 3)
{
Console.WriteLine(“March is the third month of the year”);
}
else if (month == 4)
{
Console.WriteLine(“April is the fourth month of the year”);
}
else if (month == 5)
{
Console.WriteLine(“May is the fifth month of the year”);
}
else if (month == 6)
{
Console.WriteLine(“June is the sixth month of the year”);
}
else if (month == 7)
{
Console.WriteLine(“July is the seventh month of the year”);
}
else if (month == 8)
{
Console.WriteLine(“August is the eighth month of the year”);
}
else if (month == 9)
{
Console.WriteLine(“September is the ninth month of the year”);
}
else if (month == 10)
{
Console.WriteLine(“October is the tenth month of the year”);
}
else if (month == 11)
{
Console.WriteLine(“November is the eleventh month of the year”);
}
else if (month == 12)
{
Console.WriteLine(“December is the twelfth month of the year MERRY CHRISTMAS”);
}
Console.Write(“Enter the Number of the Month: “);
month = Convert.ToInt32(Console.ReadLine());
{
}
{
Console.ReadLine();
}