SyntaxFix
Write A Post
Hire A Developer
Questions
Use break, as such:
while(choice!=99) { cin>>choice; if (choice==99) break; //exit here and don't get additional input cin>>gNum; }
This works for for loops also, and is the keyword for ending a switch clause. More info here.