Hi there, I'm trying to learn C++ with no past programming experience, and I have encountered a problem.
You see, I made this program which works perfectly:
Code:
#include <iostream>
using namespace std;
int main()
{
int password;
cout<<"Please enter the password (made of 4 numbers) to learn the two rules of success: ";
cin>> password;
cin.ignore();
if ( password == 1337) {
cout<<"The two rules of success are:\n 1.Never tell everything you know.";
}
else if ( password >= 1300 || password <=1400 ) {
cout<<"Close enough, but this is not the password.";
}
else {
cout<<"Get out of my sight, this is not even close to the password!";
}
cin.get();
}
The problem is that when I try to change the bolded line to:
else if !( password >= 1300 || password <=1400 ) {
the program says there is an error: syntax error before '!' token.
What's wrong with my program