what does this function mean?

gladi (45)
Hi everyone,
I have this function I did not understand it and I don't get the condition in the if statement. If you can please explain this function.

Thank you in advance.

1
2
3
4
5
6
7
8
bool DateAndTime::leapYear()
{
	
	if(year % 400 == 0 || (year % 4 == 0 && year % 100 != 0))
	return true;
	else
		return false;
}
eraggo (146)
if(year % 400 == 0 If year is divisible by 400 it is leap year
|| OR
(year % 4 == 0 && year % 100 != 0)) if year is divisible by 4 AND(&&) NOT(!) divisible by 100 year is leap year.
Registered users can post here. Sign in or register to post.