- 1

What am I wrong?

unexpected erro

22nd Jun 2017, 4:32 PM
Min Khant
Min Khant - avatar
4 Answers
+ 1
change: cin >> a, b; to: cin >> a >> b;
22nd Jun 2017, 4:59 PM
ChaoticDawg
ChaoticDawg - avatar
+ 3
you can not write cin like these it should be these way cin>>a>>b;
9th Jul 2017, 3:27 PM
Nafiseh Moghanizadeh
Nafiseh Moghanizadeh - avatar
+ 1
#include <iostream> using namespace std; int main() { int x; int a, b, c; cout << "Enter the two number plz!"<< endl; cin >> a, b; cout << "Choose one of the following!"<<endl; cout << "1 for Addition, 2 for Subtraction, 3 for multiplication, 4 for division, 5 for modulus"<<endl; cin >> x; switch (x) { case 1: c = a + b; cout << "The Sum of the two numbers is "<< c << endl; cout << "This operation use the '+' operator."; break; case 2: c = a - b; cout << "The Difference of the two numbers is "<< c << endl; cout << "This operation use the '-' operator."; break; case 3: c = a * b; cout << "The Product of the two numbers is "<< c << endl; cout << "This operation use the '*' operator."; break; case 4: c = a / b; cout << "The Quotient of the two numbers is "<< c << endl; cout << "This operation use the '/' operator."; break; case 5: c = a % b; cout << "The Remainder of the two numbers is "<< c << endl; cout << "This operation use the '%' operator."; break; default: cout << "Choose Only 1, 2, 3, 4, 5, you asshole!"; } return 0; }
22nd Jun 2017, 4:32 PM
Min Khant
Min Khant - avatar
+ 1
@ChaoticDawg thank you
22nd Jun 2017, 5:05 PM
Min Khant
Min Khant - avatar