LeapYear
Submit solution
C
Points:
20 (partial)
Time limit:
8.0s
Memory limit:
64M
Author:
Problem type
Allowed languages
Write a C program to find whether a given year is a leap year or not. A leap year is exactly divisible by 4 except for century years (years ending with 00). The century year is a leap year only if it is perfectly divisible by 400.
Sample Inputs
2019
2020
Sample Outputs
noleap
leap
Comments
.
.
include<stdio.h>
int main() { int a; scanf("%d",&a); if(a%400==0) printf("leap"); else if(a%100==0) printf("noleap"); else if(a%4==0) printf("leap"); else printf("noleap"); }