All major conceptual S2 C-Programs with Algorithms
#include <stdio.h>
void main() {
int year;
// Read the year from the user
printf("Enter a year: ");
scanf("%d", &year);
// A year is a leap year if it is divisible by 4 and NOT divisible by 100
// but a leap year if it divisible by 400
// Check if the year is a leap year
if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {
printf("%d is a leap year.\n", year);
} else {
printf("%d is not a leap year.\n", year);
}
}