Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int num1;
- int num2;
- int ans;
- char command;
- cout << "Calc v[0.1]" << endl;
- cout << "Enter Your Calculations :";
- cin >> num1 >> command >> num2;
- if(command == '*') {
- ans = num1 * num2;
- }
- if(command == '/') {
- ans = num1 / num2;
- }
- if(command == '+') {
- ans = num1 + num2;
- }
- if(command == '-') {
- ans = num1 - num2;
- }
- cout << ans << endl;
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement