One year has the length of 365 days, 5 hours, 48 minutes and 45 seconds. This is hard to calculate with, so a normal year has been given 365 days and a **leap year** 366 days. In **leap years**, February 29th is added as leap day, which doesn't exist in a normal year. A **leap year** is every 4 years, but not every 100 years, then again every 400 years.

using System; namespace ProgramToCheckLeapYear { class Program { static void Main(string[] args) { int year; Console.Write("Enter the Year :"); year = Convert.ToInt32(Console.ReadLine()); if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) Console.WriteLine("Year is Leap Year"); else Console.WriteLine("Year is not a Leap Year"); Console.ReadKey(); } } }

Output - C# Program To Check Year is Leap Year or Not

Enter the Year : 2004 Year is Leap Year

Recent Posts

C# - Generic Collection Namespace
C# - Generic List Class
C# - Path Class & Special Folders
C# - Regular Expressions Classes
C# - Directory & DirectoryInfo Class
C# - File & FileInfo Class
Features of C
Check Number Is Armstrong Number Or Not Using Function
Program To Check Number Is Palindrome Or Not Using Function
Program To Calculate Power Using Function

Popular Posts

Calculate Area And Perimeter Of Rectangle
C# - .NET Framework
Palindrome Number Series from 1 to 500
Program To Check Number Is Palindrome Or Not Using Function
Calculating The Area and The Perimeter of Rectangle C# Program
C# Program To Print Muliplication Table of Number
C# Simple Interest Application Example
Program To Find Power of a Number using for loop
Program To Calculate Power Using Function
Program to Calculate Power Number