while loop

while loop

Executes a statement repeatedly, until the value of expression becomes equal to zero. The test takes place before each iteration.

Syntax

while ( expression ) statement
登录查看完整内容
expression - any expression of scalar type. This expression is evaluated before each iteration, and if it compares equal to zero, the loop is exited.