Rainrix2001

Run 2

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