I am supposed to make a program that shows all the leap years are between someone's birth year and the present time. With the current code, it starts at 824 no matter what number I input. Can someone please help?
#include <iostream>
using namespace std;
int main()
{
int year;
cout <<"Enter your year of birth." << endl;
cin >> year;
for (int year = 0; year <= 2012; year++)
if ((year % 400 == 0) || (year % 4 == 0))
cout <<year<< " is a leap year." << endl;
#include <iostream>
usingnamespace std;
int main()
{
int year;
cout <<"Enter your year of birth." << endl;
cin >> year;
for (int i = year; i <= 2012; i++)
{
if ((i % 400 == 0) || (i % 4 == 0))
{
cout << i << " is a leap year." << endl;
}
}
return 0;
}