Advertisement
Guest User

Untitled

a guest
Apr 29th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. int main() {
  2. double x, y;
  3. char p;
  4. cout << "\n";
  5. cout << "---------------------------------- \n";
  6. cout << "1-st numb : ";
  7. cin>>x;
  8. system("cls");
  9. cout << x << "\n";
  10. cout << "---------------------------------- \n";
  11. cout << "sign : ";
  12. cin >> p;
  13. system("cls");
  14. if (p == '+') {
  15. cout << x << "+ \n";
  16. cout << "---------------------------------- \n";
  17. cout << "2-nd numb : ";
  18. cin >> y;
  19. system("cls");
  20. cout << x << "+"<< y<< "="<< x + y<< "\n";
  21. cout << "---------------------------------- \n";
  22. cout << "Ez \n\n";
  23. system("pause");
  24. }
  25. else if (p == '-') {
  26. cout << x << "- \n";
  27. cout << "---------------------------------- \n";
  28. cout << "2-nd numb : ";
  29. cin >> y;
  30. system("cls");
  31. cout << x << "-" << y << "=" << x - y << "\n";
  32. cout << "---------------------------------- \n";
  33. cout << "Ez \n\n";
  34. system("pause");
  35. }
  36. else if (p == '*') {
  37. cout << x << "* \n";
  38. cout << "---------------------------------- \n";
  39. cout << "2-nd numb : ";
  40. cin >> y;
  41. system("cls");
  42. cout << x << "*" << y << "=" << x * y << "\n";
  43. cout << "---------------------------------- \n";
  44. cout << "Ez \n\n";
  45. system("pause");
  46. }
  47. else if (p == '/') {
  48. cout << x << "/ \n";
  49. cout << "---------------------------------- \n";
  50. cout << "2-nd numb : ";
  51. cin >> y;
  52. system("cls");
  53. cout << x << "/" << y << "=" << x / y << "\n";
  54. cout << "---------------------------------- \n";
  55. cout << "Ez \n\n";
  56. system("pause");
  57. }
  58. else {
  59. system("cls");
  60. cout << "Error";
  61. system("pause");
  62. }
  63. system("pause");
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement