- 1
What am I wrong?
unexpected erro
4 Answers
+ 1
change:
cin >> a, b;
to:
cin >> a >> b;
+ 3
you can not write cin like these
it should be these way
cin>>a>>b;
+ 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;
}
+ 1
@ChaoticDawg thank you