Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int input1;
- int input2;
- int function;
- cout << "1 is multiply, 2 is divide, 3 is addition, 4 is subtraction?" << endl;
- cin >> function;
- if(function == 1)
- {
- cout << "OK, multiplying" << endl;
- cout << "Enter your numbers" << endl;
- cin >> input1 >> input2;
- cout << "The answer is " << input1*input2 << endl;
- }
- else if(function == 2){
- cout << "OK, dividing" << endl;
- cout << "Enter your numbers" << endl;
- cin >> input1 >> input2;
- cout << "The answer is " << input1/input2 << endl;
- }
- else if(function == 3){
- cout << "OK, adding" << endl;
- cout << "Enter your numbers" << endl;
- cin >> input1 >> input2;
- cout << "The answer is " << input1+input2 << endl;
- }
- else if(function == 4){
- cout << "OK, dividing" << endl;
- cout << "Enter your numbers" << endl;
- cin >> input1 >> input2;
- cout << "The answer is " << input1/input2 << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement