Gentee Programming Language > Documentation > Syntax | Download documentation |
The while statement is a simple loop. The while statement has the following parts: a keyword, a conditional expression and a loop body (block).
<while> ::= while <expression><block>
The execution of the loop body is repeated until the value of the expression evaluates to FALSE. The loop is never executed, if the value is zero when the test is performed for the first time.
while a
{
ñ=c+a
a--
}
The do statement contains the do keyword, a loop body, the while keyword and a conditional expression.
<dowhile> ::= do <block> while <expression>
The execution of the loop body is also repeated until the value of the expression evaluates to FALSE. Unlike the while statement, the test is performed after the execution of the loop body is completed and the iteration occurs at least once.
do{
c=c+a
a--
}
while a
See also
return, break, continue Instructions
Copyright © 2004-2006 Gentee Inc. All rights reserved. |