5.5 — While statements « Learn C++
The while statement is the simplest of the three loops that C++ provides. It’s definition is very similar to that of an if statement: while (expression) statement; A while statement is declared using the while keyword. When a while statement is executed, ...