Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdio.h>
- using namespace std;
- int a;
- int b;
- string math;
- int main() {
- cout << "Enter a number: " << endl;
- cin >> a;
- cout << "Enter another number: " << endl;
- cin >> b;
- cout << "Enter method of math (+ - * /)" << endl;
- cin >> math;
- if (math == "+") {
- cout << a + b << endl;
- } else if (math == "-") {
- cout << a - b << endl;
- } else if (math == "*") {
- cout << a * b << endl;
- } else if (math == "/") {
- cout << a / b << endl;
- } else {
- cout << "That is not a valid method of math!" << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement