Write a program to find entered year is a leap year or not a leap year.
#include<conio.h>
#include<stdio.h>
void main()
{
int year;
clrscr();
printf("Enter Year:");
scanf("%d",&year);
if(year%4==0 || year%400==0)
{
printf("%d is leap year...!!!",year);
}
else
{
printf("%d is not a leap year...!!!",year);
}
getch();
}
O/P:
#include<conio.h>
#include<stdio.h>
void main()
{
int year;
clrscr();
printf("Enter Year:");
scanf("%d",&year);
if(year%4==0 || year%400==0)
{
printf("%d is leap year...!!!",year);
}
else
{
printf("%d is not a leap year...!!!",year);
}
getch();
}
O/P: