Is Leap Year
This algorithm finds is input year a leap year.
static bool IsLeapYear(unsigned int year) {
return (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
}
Example
bool value = IsLeapYear(2016);
Output
true