Created
August 19, 2018 06:27
-
-
Save MdKutubuddinSardar/45e3c2d1183724ec26496b30b4e6836e to your computer and use it in GitHub Desktop.
C program to check leap year
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*C program to check leap year */ | |
/* Author : Md Kutubuddin Sardar*/ | |
/*Date: 19.08.2018*/ | |
#include <stdio.h> | |
int main() | |
{ | |
int y; | |
printf("Enter a year to check if it is a leap year y = "); | |
scanf("%d", &y); | |
if ( y%400 == 0 || y%100!=0 && y%4==0) | |
printf("%d is a leap year.\n", y); | |
else | |
printf("%d is not a leap year.\n", y); | |
} | |
/** | |
OUTPUT: | |
Enter a year to check if it is a leap year | |
1998 | |
1998 is not a leap year. | |
/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment