Guest User

Untitled

a guest
Nov 23rd, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <windows.h>
  4. using namespace std;
  5. string answer;
  6. int a;
  7. int calc(){
  8.  
  9. int b;
  10. int c;
  11. int d;
  12. int e;
  13. int f;
  14.  
  15. cout << "Enter a Number: ";
  16. cin >> a;
  17.  
  18. cout << "Enter a 2nd Number: ";
  19. cin >> b;
  20. cout << "\n";
  21.  
  22. c = a+b;
  23. d = a-b;
  24. e = a*b;
  25. f = a/b;
  26.  
  27. cout << "The sum is: " << c << endl << endl;
  28. cout << "The subtraction is: " << d << endl << endl;
  29. cout << "The solution is: " << e << endl << endl;
  30. cout << "The divison answer is: " << f << endl << endl;
  31. return 0;
  32.  
  33. }
  34. int main(){
  35.  
  36. cout << "Woud you like to use the Calculator?" << endl;
  37. cin >> answer;
  38.  
  39. if(answer == "yes"){
  40. cout << "Here's a simple Addition Math Problem" << endl;
  41. calc();
  42. cin.get();
  43. }
  44. else{
  45. cout << "damn" << endl;
  46. cin.get();
  47. return 0;
  48. }
  49. main();
  50. cin.get();
  51. return 0;
  52. }
Add Comment
Please, Sign In to add comment