Electrical and Computer Engineering
11 of 31
UAH
CPE 112
The do-while Statement
•DoWhileStatement
•do
•      Statement
•while (Expression);
•
•Example
•do
•{
•   cout << “Enter your age: ” ;
•   cin >> age;
•   if (age <= 0)
•      cout << “Your age must be positive.” << endl;
•} while (age <= 0);