npaul19 / hacktoberfest

2 stars 44 forks source link

Solve leapyear problem #115

Closed hendrixjoseph closed 2 years ago

hendrixjoseph commented 2 years ago

Solved the leap year problem: leap years are those years that are divisible by 4, except those years that are divisible by 100, in which case those years that are divisible by 100 are only leap years if they are also divisible by 400.

Thus 1900 is not a leap year despite being divisible by 4 because it is not divisible by 400.

However, 2000 is a leap year because it is divisible by 400.