bool leap = false;
int leapd = 28;
if (year % 100 == 0) {
if (year % 400 == 0) {
leap = true;
}
else { leap = false; }
}
else if (year % 4 == 0) {
leap = true;
}
else { leap = false; }
if (leap = true) {
leapd++;
}
This program decides if the year entered is a leap year or not. I'm not sure why, but the program will always set leap
to true in the end.
If the year is divisible by 100, than it is a leap year if it also is divisible by 400.
If it is not divisible by 100, it is only a leap year if you can divide the year by 4.