Any year is input through the keyboard. Write a program in C to determine whether the year is a leap year or not.
#include <stdio.h>
#include <conio.h>
void main() {
int year; clrscr();
printf("Enter a year : ");
scanf("%d", &year);
if(year%4==0) {
printf("\n%d is a leap year");
} else {
printf("\n%d is NOT a leap year");
}
getch();
}
#include <conio.h>
void main() {
int year; clrscr();
printf("Enter a year : ");
scanf("%d", &year);
if(year%4==0) {
printf("\n%d is a leap year");
} else {
printf("\n%d is NOT a leap year");
}
getch();
}
Post a Comment