Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int a;
- int b;
- int c;
- cout << "Will you be adding(1), subtracting(2), multiplying(3) or dividing(4)? " << endl;
- cin >> c;
- cout << "Enter a number " << endl;
- cin >> a;
- cout << "Enter another number " << endl;
- cin >> b;
- if(c==1){
- cout << "The answer is " << a+b << endl;
- }
- if(c==2){
- cout << "The answer is " << a-b << endl;
- }
- if(c==3){
- cout << "The answer is " << a*b << endl;
- }
- if(c==4){
- cout << "The answer is " << a/b << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement