Restart program

Hi guys i have a question
i am currently doing a calculator program is there any way that after finishing one calculation

i give the user an option to either enter a specific alphabet to end the program or any other key to continue with another calculation.
if so. wad will be the code for it?

appreciate all your help.
1
2
3
4
5
6
7
8
9
int main(){
    while(true){
        cout << "look mom, I'm calculating!\n";

        cout << "Do you want to repeat? (y/n) "
        if(cin.get()=='n') break;
    }
    return 0;
}


It would of course be good to use strings and handle all inputs that don't make sense and so on, but I'll leave that to you.
Last edited on
Topic archived. No new replies allowed.