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"; } }

31st Mar 2016, 6:29 PM
Dimitry
Dimitry - avatar
8 Antworten
+ 5
Also, place return 0; just before the last right curly race. }
24th Apr 2016, 8:53 AM
ic01010101 ◼️LM
ic01010101 ◼️LM - avatar
+ 4
Remove ">>endl" from cin.
14th Apr 2016, 12:43 PM
Paweł Gliniecki
Paweł Gliniecki - avatar
+ 1
only place return 0; before last scope
13th Jun 2016, 4:45 PM
DJ Shiva & DJ Baba Shiv-Shekhar
DJ Shiva & DJ Baba Shiv-Shekhar - avatar
+ 1
you're assigning a value to endl (endline) which makes no sense, but that's ok, everyone makes mistakes
20th Jun 2016, 7:11 AM
Matheus Fernandes
Matheus Fernandes - avatar
0
cin>>a; cin>>b; this is right not use endl; here
13th Jun 2016, 11:27 AM
sulaiman
0
the main problem is due to not writing return 0; writing endl does not cause any problem here.
16th Jun 2016, 6:01 AM
Vivek Sharma
Vivek Sharma - avatar
0
remove end from cin statement
16th Jun 2016, 9:46 AM
Dheeraj Varshney
Dheeraj Varshney - avatar
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; }
20th Jun 2016, 3:36 PM
Quophi Nettdata
Quophi Nettdata - avatar