Immediate exit of ‘while’ loop in C++ [closed]

Use break?

while(choice!=99)
{
  cin>>choice;
  if (choice==99)
    break;
  cin>>gNum;
}

Leave a Comment