Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- main(){
- double num1, num2;
- char symbol;
- cout << "Enter first number: " << endl;
- cin >> num1;
- cout << "Enter symbol (+, -, *, /):" << endl;
- cin >> symbol;
- cout << "Enter second number: " << endl;
- cin >> num2;
- if(symbol == '+') {
- cout << "Result: " << num1+num2;
- }else
- if(symbol == '-') {
- cout << "Result: " << num1-num2;
- }else
- if(symbol == '*') {
- cout << "Result: " << num1*num2;
- }else
- if(symbol == '/') {
- cout << "Result:" << num1/num2;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement