CPP
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Asking for input over and over
#include<iostream>
#include<string>
using namespace std;
int main ()
{
int n = 0;
char choice = '0';
bool isExit = false;
do {
cout << "Number is: "; cin >> n;
do {
cout << "s)continue o)Exit "; cin >> choice;
if (choice == 's' || choice == 'S') break;
else if (choice == 'o' || choice == 'O') {isExit = true; break;}
} while (true);
} while (!isExit);
cout << "Exited.\n";
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run