Any year is entered through the keyboard. Write a function to determine whether the year is a leap year or not.

#include<stdio.h>
main()
{

int leap_year(year);
int year, lp;

printf("Enter the year:");
scanf ("%d", &year);

lp=leap_year(year);

if (lp)

{
printf("\nThe entered year is a leap year.");
}
else
{

printf("\nThe entered year is not a leap year.");
}

}


leap_year(int y)

{
int lp;

if (y%4==0)

{
lp=1;
}
else
lp=0;

return(lp);
}









The file can be found at:
Download File

No comments:

Post a Comment

kiss on google ads if you are anonymous because your ip is trackable.thank you.

......from.admin