Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <iostream>
- using namespace std;
- int main()
- {
- int a;
- int b;
- int c;
- cout << "1 for addition\n2 for subtraction\n3 for Multiplication\n4 for Division\n";
- cin >> a;
- cout << "Enter first number." << "\n>";
- cin >> b;
- cout << "Enter second number\n>";
- cin >> c;
- if(a == 1)
- {
- cout << b+c;
- }
- else if(a == 2)
- {
- cout << b-c;
- }
- else if(a == 3)
- {
- cout << b*c;
- }
- else if(a == 4)
- {
- cout << b/c;
- }
- else
- {
- cout << "1 for Addition\n2 for Subtraction\n3 for Multiplication\n4 for Division\n";
- }
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement