class LeapYear
{
public static void Main(string[]
args)
{
int Year;
Console.WriteLine("Enter
the Year: ");
Year
= Convert.ToInt32(Console.ReadLine());
if ((Year
% 4 == 0) && (Year % 100 != 0 || Year % 400 == 0))
{
Console.WriteLine("The
Year you have entered is a LeapYear: {0}", Year);
}
else
{
Console.WriteLine("The
Year you have entered is not a Leap Year: {0}",
Year);
}
Console.ReadLine();
}
}
No comments:
Post a Comment