clsharpe

simpleCalc

Nov 5th, 2014
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int firstNum;
  4. int secNum;
  5. int calcOp;
  6. int main() {
  7. cout<<"Enter first number: \n";
  8. cin>>firstNum;
  9. cout<<"Select 1 (Add) 2 (Subtract) 3 (Multiply) 4 (Divide) \n";
  10. cin>>calcOp;
  11. cout<<"Enter second number: \n";
  12. if (calcOp==1) {
  13. firstNum = firstNum + secNum;
  14. cout<<"The answer is: " << firstNum;
  15. }
  16. cin.get();
  17. }
Advertisement
Add Comment
Please, Sign In to add comment