Monday, May 23, 2016

C program to determine whether a year is a leap year

Program
 #include<stdio.h>
main()
{
int a;
printf("enter a year :\n");
scanf("%d",&a);
if(a%4==0)
{
printf("it is a leap year");
}
else
{
printf(" it is not a ;eap year");
}
}

Output
 enter a year:
2016
it is a leap year

No comments:

Post a Comment