odd or even

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

moneo
Veteran
Posts: 451
Joined: Tue Jun 28, 2005 7:00 pm
Location: Mexico City, Mexico

Re: Divisibility by 4 ie. Leap Year

Post by moneo » Fri Dec 09, 2005 7:40 pm

zim wrote:Here's a trick I use to check for divisibility by 4, for Leap Years and such:
.....
Just in case you are not aware of it, the complete logic for determining if a year is a leap year is as follows:

If the year is evenly divisible by 4 and not divisible by 100,
or if the year is evenly divisible by 400,
then it's a leap year.
*****

Post Reply