0
What im doing wrong?it's says compilation error,help
#include <iostream> using namespace std; int main() { int a; int b; cout << " choose the first number" << endl; cin >> a >> endl; cout << "choose the second number" << endl; cin >> b >> endl; if (a > b) { cout << "accepted"; } else { cout << "denied"; } }
8 ответов
+ 5
Also, place return 0; just before the last right curly race. }
+ 4
Remove ">>endl" from cin.
+ 1
only place return 0; before last scope
+ 1
you're assigning a value to endl (endline) which makes no sense, but that's ok, everyone makes mistakes
0
cin>>a; cin>>b; this is right not use endl; here
0
the main problem is due to not writing return 0; writing endl does not cause any problem here.
0
remove end from cin statement
0
int a;
int b;
cout<<"choose the first number"<<endl;
cin>>a;
cout<<"choose the second number"endl;
cin>>b;
if(a>b){
cout<<"accepted"<<end;
}
else{
cout<<"denied"<<endl;
}
return 0;
}