Leap year
//using function
#include <stdio.h>
int power(int x)
{
if(x%400==0)
printf("%d is a leap year", x);
else if(x%100==0)
printf("%d is not a leap year ", x);
else if(x%4==0)
printf("%d is a leap year", x);
else
printf("%d is not a leap year ", x);
}
int main()
{
int a, b, p;
printf("Enter the year\n");
scanf("%d", &a);
power(a);
return 0;
}
Comments
Post a Comment