Leap Year

  • Thread starter Leap Year Error
  • Start date
L

Leap Year Error

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;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top