
Patrick B. answered 05/10/21
Math and computer tutor/teacher
using System;
class LeapYear
{
static void Main()
{
String inbuff;
int year=0;
while (year<1583 || year>3000)
{
Console.Write(" Please input the year between 1583 and 3000 :>");
inbuff = Console.ReadLine();
year = Int32.Parse(inbuff);
}
Console.Write(" The year " + year);
if (year%400==0)
{
Console.WriteLine(" is a leap year. ");
}
else
{
if (year % 100==0)
{
Console.WriteLine(" is NOT a leap year. ");
}
else
{
if (year %4==0)
{
Console.WriteLine(" is a leap year.");
}
else
{
Console.WriteLine(" is not a leap year.");
} //year divisible by 4
} //year divisible by 100
} //year divisble by 400
} //Main
} //class