We all known the logic about leap year that a year which divided by 4 is a leap year same thing we apply over here that if year%4==0 than it is leap year else not.
C program to check year is leap year or not
#include<stdio.h>
void main()
{
int year;
clrscr();
printf("Enter year:: ");
scanf("%d",&year);
if(year%4==0)
{
printf("Year is leap year");
}
else
{
printf("Year is not a leap year");
}
getch();
}
Download |
---|
0 comments:
Post a Comment