What my understanding is like:
for a year its like 365.2425 to be precise so if we take for a year (365.24 ) it leaves .24 days right it is like 6 hrs for every 4 years it adds up to 24 hrs so it will create a day we add this to feb 29 so why we are leaving the remaining
so here we leave the balance .25 days right if i am wrong correct me on this guys for every 100 year we leave .25 days (6 hrs) it adds up to 24 hrs in every 400th year we add the extra day in feb make it as a leap year
These are my understanding about the problem I saw the leap year solution.
In that one why do we check if the year is not divisible by 100? what is the need for the 100 what is the logic behind this?
// Else If a year is multiple of 100,
// then it is not a leap year
if (year % 100 == 0)
return false;
Why do we check with the 100?