C Program to Check if a Given Year is Leap Year
In this program we will check whether a given year is leap year or not. A year that has 366 days is called a leap year
- //C program to check leap year
- #include <stdio.h>
- int main()
- {
- int y;
-
- printf("Enter year: ");
- scanf("%d",&y);
-
- if(y % 4 == 0)
- {
- if( y % 100 == 0)
- {
- if ( y % 400 == 0)
- printf("%d is a Leap Year", y);
- else
- printf("%d is not a Leap Year", y);
- }
- else
- printf("%d is a Leap Year", y );
- }
- else
- printf("%d is not a Leap Year", y);
-
- return 0;
- }
Output

Solution not working or have any suggestions? Please send an email to [email protected]
Download Android App