Leap year program in CFirst of all, it is important to know what is leap year? Generally, a year has 365 days in a year, but a leap year has 366 days which comes after four year. Below are some points related to leap year:
Below conditions are used to check that year is a leap year or not.
By putting these conditions in your code, you can check year is a leap year or not. If the above conditions are satisfied, the year will be leap year. These conditions can be put with if-else or with && (and) and || (Or). How to find leap year using C programming?With the help of a C program, we will make easy to find a leap year. Example See the below example in which we check a leap year by taking input from user: Output See the below outputs for different input values: Test 1: Enter a year: 2004 2004 is a leap year Test 2: Enter a year: 1700 1700 is not a leap year Example In this below example, we will find the leap years between the range of two years like 2000 to 2020. See the below example: Output See the below output: Enter a year to start searching the leap years: 1950 Enter a year to end the search of leap years: 2020 Leap years between 1990 to 2020 are: 1992 1996 2000 2004 2008 2012 2016 2020 Next TopicPerfect Number Program in C |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India