Rainrix2001

Run

Aug 19th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int n1, n2, t;
  6.     char response;
  7.     do {
  8.     system("cls");
  9.     cout << "Problem 5 - Run Run Run\n";
  10.     cout << "-----------------------------\n";
  11.     cout << "1st Number: ";
  12.     cin >> n1;
  13.     cout << "2nd Number: ";
  14.     cin >> n2;
  15.     t = n1+n2;
  16.     cout << "The sum is: ";
  17.     cout << t << "\n\n\n";
  18.     cout << "Run the program again? \n";
  19.     cout << "[Y]es or any key to STOP! : ";
  20.  
  21.     cin >> response;
  22.     } while (response == 'Y' || response == 'y');
  23.     cout << "\n";
  24.     return 0;
  25. }
Add Comment
Please, Sign In to add comment