Advertisement
DRAWNBOX

1337 Calc

May 28th, 2015
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int input1;
  8. int input2;
  9. int function;
  10. cout << "1 is multiply, 2 is divide, 3 is addition, 4 is subtraction?" << endl;
  11. cin >> function;
  12. if(function == 1)
  13. {
  14. cout << "OK, multiplying" << endl;
  15. cout << "Enter your numbers" << endl;
  16. cin >> input1 >> input2;
  17. cout << "The answer is " << input1*input2 << endl;
  18. }
  19. else if(function == 2){
  20. cout << "OK, dividing" << endl;
  21. cout << "Enter your numbers" << endl;
  22. cin >> input1 >> input2;
  23. cout << "The answer is " << input1/input2 << endl;
  24. }
  25. else if(function == 3){
  26. cout << "OK, adding" << endl;
  27. cout << "Enter your numbers" << endl;
  28. cin >> input1 >> input2;
  29. cout << "The answer is " << input1+input2 << endl;
  30. }
  31. else if(function == 4){
  32. cout << "OK, dividing" << endl;
  33. cout << "Enter your numbers" << endl;
  34. cin >> input1 >> input2;
  35. cout << "The answer is " << input1/input2 << endl;
  36. }
  37. return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement