Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Shelton Willis
- // CS 1336.010
- // Lab 25
- #include <iostream>
- using namespace std;
- int main()
- {
- char op;
- float num1;
- float num2;
- cin >> num1;
- cin >> num2;
- cin >> op;
- switch(op)
- {
- case '+' :
- cout << num1 << " " << op << " " << num2 << " = " << num1+num2;
- break;
- case '-':
- cout << num1 << " " << op << " " << num2 << " = " << num1-num2;
- break;
- case 'X':
- case 'x':
- case '*':
- cout << num1 << " " << op << " " << num2 << " = " << num1*num2;
- break;
- case '/':
- cout << num1 << " " << op << " " << num2 << " = " << num1/num2;
- break;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement