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:

CSharp-Program-to-Check-Leap-Year

CSharp-Program-to-Check-Leap-Year
 

 
We are nothing without our users ! You can help us offer even more high quality content. Please share our page !
Best quality Asp .Net Ajax Control Toolkit tutorials.

Give your valuable comments.

Name
Email
Comment
8 + 6 =
 
About Us | Terms of Use | Privacy Policy | Disclaimer | Contact Us Copyright © 2012-2022 CodingFusion
75 Important SQL Server queries you should know