Use break?
while(choice!=99)
{
cin>>choice;
if (choice==99)
break;
cin>>gNum;
}
More Related Contents:
- Why do I keep getting an "expected expression error" in my While Loop? [closed]
- C++: While Looping Amount of Times
- Lowercase letters that did not appear in the array, in order [closed]
- Loops in loops and increment staying at 0 in C++ [closed]
- c++ skipping the if and for loops?
- Don’t know how to add loop to my program…?
- Can I use break to exit multiple nested ‘for’ loops?
- Integer validation for input
- Break out of a while loop that contains a switch statement
- How to break out of a loop from inside a switch?
- What exactly is nullptr?
- Which, if any, C++ compilers do tail-recursion optimization?
- Create Random Number Sequence with No Repeats
- Why can’t variable names start with numbers?
- printf with std::string?
- How should I deal with mutexes in movable types in C++?
- lifetime of a std::initializer_list return value
- C++ How to detect Windows 10
- May I take the address of the one-past-the-end element of an array? [duplicate]
- error LNK2005: already defined – C++
- c++ lambdas how to capture variadic parameter pack from the upper scope
- Why use a const member function?
- Why does valgrind say basic SDL program is leaking memory?
- Various questions about RSA encryption
- Why does libc++’s implementation of std::string take up 3x memory as libstdc++?
- Why was std::pow(double, int) removed from C++11?
- How to prevent non-specialized template instantiation?
- Problem with compiling RInside examples under Windows
- On OS X, simple C++ program gives incorrect results (which are a result of command-line options ‘c++03’ vs ‘c++11’)
- Output aligned columns