Comment

Hubert Partl

January 2, 2008 at 4:52 PM

Your leap year example gives false results for the years 1900, 2100 and others.

The leap year rules are:

1. Years that are multiples of 4 are leap years,

except for the following special years.

2. Years that are mutliples of 100 are not leap years, except for the following special years.

3. Years that are multiples 400 are leap years.

Your program does not obey to rule 2.

View All Comments | View Tutorial

The leap year rules are:

1. Years that are multiples of 4 are leap years,

except for the following special years.

2. Years that are mutliples of 100 are not leap years, except for the following special years.

3. Years that are multiples 400 are leap years.

Your program does not obey to rule 2.

View All Comments | View Tutorial

Related Tutorial and Articles

Advertisements
Advertisements