The while loop tests condition, and if condition is true, while executes statement. This repeats until condition is false. If condition contains a declaration, the declaration is in the same scope as statement. Examplewhile (cin >> num) data.push_back(num); See Alsobreak, continue, do, expression, for, statement, Chapter 4 |