Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // do-while loop for deciding to repeat a section of code
- do{
- // initialize variables
- char ans;
- // prompt
- // Echo inputs
- // calculation
- cout << "\nHello\n\n";
- cout << "Continue Program (y/n) ? \n";
- cin >> ans;
- } while(ans == 'y' || ans == 'Y');
- // output
- cout << "\n\t\t\t\t\t\t\tGood-bye\n";
- cout << "\n\n\t\t\t\t\t\t\t~ End of Program ~\n" << endl;
Add Comment
Please, Sign In to add comment