cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
error:expected '(' before 'not' tolken H
error:expected '(' before 'not' tolken HElP!
Sep 13, 2015 at 7:24pm UTC
Xrey274
(16)
#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
Sep 13, 2015 at 7:52pm UTC
Sep 13, 2015 at 7:48pm UTC
Peter87
(11238)
If conditions has to be inside parentheses.
Sep 14, 2015 at 7:05am UTC
YFGHNG
(319)
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.