Input a year.Display the message “LEAP YEAR “ If the entered year has 366 days, other wise Display the message “NOT A LEAP YEAR “.
Answers
Answered by
3
So in general leap year is found by dividing with 4
If year is divisible by 4 then its leap year.
Input year;
If(year/4==0)
{pf("leap year");}
Else
{pf("not a leap year");}
But if u need that "program to check according to number of days in year entered" then we should manually store number of days in storage or we should write a logic stating each year entered has 0.25 day extra which should be added.
So divisible by 4 is better
If year is divisible by 4 then its leap year.
Input year;
If(year/4==0)
{pf("leap year");}
Else
{pf("not a leap year");}
But if u need that "program to check according to number of days in year entered" then we should manually store number of days in storage or we should write a logic stating each year entered has 0.25 day extra which should be added.
So divisible by 4 is better
Answered by
0
Answer:
answer is in the picture.
Attachments:
![](https://hi-static.z-dn.net/files/db2/33ab15b46e3b62c4463ab3cf94857c69.jpg)
Similar questions