Skip to main content

Leap year or not

#include <stdio.h> int main() { int year; printf("Enter year : "); scanf("%d", &year); if (((year % 4 == 0) && (year % 100!= 0)) || (year % 400 == 0)) printf("\n%d is a leap year", year); else printf("\n%d is not a leap year", year); return 0; }



Enter year :  2020

2020 is a leap year. 

Comments