1 year, 8 months ago
How many days has a year
You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.
M$1 Answer
Hi there, and welcome to Mahalo
A year tilically has 365 days, unless it's a leap year, in which case it has 366 days.
You can define whether a year is a leap year following this 'pseudocode' algorithm:
if year modulo 400 is 0
then is_leap_year
else if year modulo 100 is 0
then not_leap_year
else if year modulo 4 is 0
then is_leap_year
else
not_leap_year
So, a year is a leap yearif it can be divided by four, but not if it can be divided by 100, and again if it can be divided by 400.
A year tilically has 365 days, unless it's a leap year, in which case it has 366 days.
You can define whether a year is a leap year following this 'pseudocode' algorithm:
if year modulo 400 is 0
then is_leap_year
else if year modulo 100 is 0
then not_leap_year
else if year modulo 4 is 0
then is_leap_year
else
not_leap_year
So, a year is a leap yearif it can be divided by four, but not if it can be divided by 100, and again if it can be divided by 400.
You can leave an optional "tip" with Mahalo's virtual currency, Mahalo Dollars. If you are asking a difficult question that might require some research, or if you'd like a wide variety of feedback, a higher tip often leads to more answers to your question.
M$Report Abuse
