Skip to content

Instantly share code, notes, and snippets.

@MdKutubuddinSardar
Created August 19, 2018 06:27
Show Gist options
  • Save MdKutubuddinSardar/45e3c2d1183724ec26496b30b4e6836e to your computer and use it in GitHub Desktop.
Save MdKutubuddinSardar/45e3c2d1183724ec26496b30b4e6836e to your computer and use it in GitHub Desktop.
C program to check leap year
/*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