// Program
//The year which is divisible by 400,100 and 4 is called leap year.
#include<stdio.h>
void main()
{
int a,year;
printf("Enter any year:");
scanf("%d",&year);
if((year%400)==0)
{
printf("Leap year");
}
else if((year%100)==0)
{
printf("Leap year");
}
else if((year%4)==0)
{
printf("Leap year");
}
else
printf("Not leap year");
getch();
}
Sample Input/Output:
Enter any year:2004
Leap year
//The year which is divisible by 400,100 and 4 is called leap year.
#include<stdio.h>
void main()
{
int a,year;
printf("Enter any year:");
scanf("%d",&year);
if((year%400)==0)
{
printf("Leap year");
}
else if((year%100)==0)
{
printf("Leap year");
}
else if((year%4)==0)
{
printf("Leap year");
}
else
printf("Not leap year");
getch();
}
Sample Input/Output:
Enter any year:2004
Leap year
No comments:
Post a Comment