If and else if

This is my code. Why won’t it tell people if there input variable is or is not a leap year. It keeeeeeps returning 0. It lets me input the variable x, but after that return zero;
#include
using namespace std;
int main() {
int x = 0;
cout << " enter your birth year\n";
cin >> x;
if (x < 1000 or x > 9999 )
{ cout << “that is an invalid response\n”;
}
else if ( x % 4 == 0 and x % 100 == 0 or x % 400 == 0) { cout << " your birth year was a leap year, you’re now cool\n"; }

}

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.