Electrical and Computer Engineering
2 of 23
UAH
CPE 112
The while Statement
•WhileStatement
–While (Expression)
•Statement
•Example:
–while (inputVal != 25)
•cin >> inputVal;
•If the expression has a value of false, the program skips the loop body and execution continues at the statement immediately following the loop.