C# Program to Check Leap Year
In this C# program, we will take the input from the user and check whether the input year is a Leap Year or not. Leap year is a year which is divisible by 4.
C# Program to Check Leap Year Code:
private static void Main(string[] args)
{
Console.Write("Enter a year: ");
int year = int.Parse(Console.ReadLine());
if (year % 4 == 0)
{
Console.WriteLine("Entered year {0} is a leap year.", year);
}
else
{
Console.WriteLine("Entered year {0} is not a leap year.", year);
}
Console.ReadLine();
}
C# Program to Check Leap Year Output: