C Program To Check Given Year Is Leap Year Or Not
Example
#include <stdio.h> void main() { int year; printf("nn Enter The Year: "); scanf("%d", & year); if (year % 100 == 0) { if (year % 400 == 0) printf("n %d is a Leap Year", year); } else{ if (year % 4 == 0) printf("n %d is a Leap Year", year); else printf("n %d is a not Leap Year", year); } }
Output:
Enter The Year: 2024 2024 is a Leap Year