Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int firstNum;
- int secNum;
- int calcOp;
- int main() {
- cout<<"Enter first number: \n";
- cin>>firstNum;
- cout<<"Select 1 (Add) 2 (Subtract) 3 (Multiply) 4 (Divide) \n";
- cin>>calcOp;
- cout<<"Enter second number: \n";
- if (calcOp==1) {
- firstNum = firstNum + secNum;
- cout<<"The answer is: " << firstNum;
- }
- cin.get();
- }
Advertisement
Add Comment
Please, Sign In to add comment