Search This Blog

Google Analytics

Thursday, February 28, 2008

Pseudocode to Determine Leap Year

Definition of Leap Years
http://hongjun.blogspot.com/2006/08/definition-of-leap-years.html

Pseudocode to determine leap year
if year modulo 400 is 0 then is_leap
else if year modulo 100 is 0 then no_leap
else if year modulo 4 is 0 then is_leap
else no_leap
And if you find yourself working extra 1 day on a February, then it's a leap year. Year 2008 is a leap year.

No comments:

Post a Comment

Do provide your constructive comment. I appreciate that.

Popular Posts