+ 1
Loop
What loop code should I use to have the following simple calculator to run after an operation without the window closing and having to rerun to perform another operation? https://code.sololearn.com/cnK46c0mQjj5/?ref=app
2 Réponses
+ 1
Put it inside a while (true) { … } loop
+ 1
Put all your program inside a while(True){}. For break, put a if statement get some key like k to be press. For example:
cin >> keyForBreak;
if (keyForBreak == ‘a’) break;