JS Program to check leap year
Jan 28, 2021
A year is a leap year if the following conditions are satisfied: the year is a multiple of 400 and the year is a multiple of 4 not a multiple of 100.
As you see I used logical operators to check if a year is leap year or not.
I checked that if the year is equal 0 and divisible by 4 and the year not equal 0 but divisible by 100 or year is equal 0 and divisible by 400 is a leap year.
I think my code is a little bit confusing.
But in this case our year isn’t leap year because it didn’t satisfy the conditions.
As you see 2003 isn’t a leap year it can't satisfy leap year conditions.