Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int firstnum, secondnum;
- char arithmetic_operations;
- cout << "Enter first number: ";
- cin >> firstnum;
- cout << "Enter second number: ";
- cin >> secondnum;
- cout << "Enter Arithmetic Operations (+, -, *, /): ";
- cin >> arithmetic_operations;
- if (arithmetic_operations == '+')
- cout << firstnum << " + " << secondnum << " = " << firstnum + secondnum << endl;
- else if (arithmetic_operations == '-')
- cout << firstnum << " - " << secondnum << " = " << firstnum - secondnum << endl;
- else if (arithmetic_operations == '*')
- cout << firstnum << " * " << secondnum << " = " << firstnum * secondnum << endl;
- else if (arithmetic_operations == '/')
- cout << firstnum << " / " << secondnum << " = " << firstnum / secondnum << endl;
- else
- cout << "You typed an invalid arithmetic operations!\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement