error:expected '(' before 'not' tolken HElP!

#include <iostream>

using namespace std;
int main()
{
int a;
int b;

cin >> a;
cin >> b;
if(a > b)
{
int a;
int b;
cout <<"Xrey274 is AWESOME!"<<endl;
}
if not ( a > b)
{
int a;
int b;
cout <<"Xrey274 is not AWESOME :("<<endl;
}
return 0;
}
Last edited on
If conditions has to be inside parentheses.
What Peter87 said is correct. You'll also want to consider the negation operator ! which will work if you wrote

if (!(a>b))

Also, you don't need the repeated int a, b inside your if statements. You'll might want to read up a little bit about if, then, else as well.

http://www.cplusplus.com/doc/tutorial/control/
Topic archived. No new replies allowed.