Leap Year

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The algorithm in Excel for leap years is off in the year 1900. January 1,
1900 should start on Monday, not Sunday, and is not a leap year. Use the
following C++ code:

bool leapYear = false;

if(year % 4) leapYear = true;
if(year % 100) leapYear = false;
if(year % 400) leapYear = true;
 
Back
Top