[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
WHILE
The while statement is used to loop continuously while a certain
condition is true. It has the form
while (<expression>)
<statement>
<statement> would continue to be repeated over and over while
<expression> evaluated to non-zero (TRUE). Note that if the ex-
pression evaluates to 0 (FALSE) from the beginning, the statement
will never be executed. Again, multiple statements may be used by
surrounding them in curly braces. A few examples are:
while (stat != -1)
stat = myfunc();
while (num < 100)
{
printn(num);
prints("");
num = num + 1;
}
while (1)
{
if (func1())
return 0;
func2();
}
Again, be careful to not place a semicolon after the parenthesis
ending the expression.
See Also:
break
continue
do
for
operators
expressions
statements
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson