rendered paste body #include <iostream>
using namespace std;
int main()
{
float n;
float a;
float b;
cout << "Enter 1 for addition\n";
cout << "Enter 2 for subtraction\n";
cout << "Enter 3 for multiplication\n";
cout << "Enter 4 for division\n";
cout << "Your choice: ";
cin >> n;
if (n==1) {
cout << "Enter the 1.summand: ";
cin >> a;
cout << "Enter the 2.summand: ";
cin >> b;
cout << a << " + " << b << " = " << a+b << endl;
}
else if (n==2) {
cout << "Enter the minuend: ";
cin >> a;
cout << "Enter the subtrahend: ";
cin >> b;
cout << a << " - " << b << " = " << a-b << endl;
}
else if (n==3) {
cout << "Enter the 1.factor: ";
cin >> a;
cout << "Enter the 2.factor: ";
cin >> b;
cout << a << " x " << b << " = " << a*b << endl;
}
else if (n==4) {
cout << "Enter the dividend: ";
cin >> a;
cout << "Enter the divisor: ";
cin >> b;
cout << a << " : " << b << " = " << a/b << endl;
}
else {
cout << "invalid choice" << endl;
}
system("PAUSE");
return 0;
}