Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. enum Process
  6. {
  7. Plus = 0,
  8. Minus = 1,
  9. Multiply = 2,
  10. Division = 3
  11. };
  12.  
  13. int main()
  14. {
  15. int num0, num1;
  16.  
  17. int value = 0;
  18.  
  19. std::cout << "enter a number: " << endl;
  20. cin >> num0;
  21.  
  22. cout << "process: " ;
  23. cin >> value;
  24.  
  25. cout << "enter a number: " << endl;
  26. cin >> num1;
  27.  
  28. switch (value)
  29. {
  30. case Plus:
  31. cout << num0 + num1 << endl;
  32. break;
  33. case Minus:
  34. cout << num0 - num1 << endl;
  35. break;
  36. case Multiply:
  37. cout << num0 * num1 << endl;
  38. break;
  39. case Division:
  40. cout << num0 / num1 << endl;
  41. break;
  42.  
  43. default:
  44. cout<<"No valid process"<<endl;
  45. break;
  46. }
  47. return 0;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement