there are two varients. The normal while
- Code: Select all
while(Conditional Statement)
{
do things here while the Conditional Statement is true
}
and the do-while
- Code: Select all
do
{
do things here
}while(Conditional Statement)
The first while loop will ONLY run if Conditional Statement is true, but if the condition is not met, the code won't get run at all.
If the Conditional Statement is true, then the code will keep on running until the Condition Statement returns false.
The do-while loop is the same thing, except that the code will get run at least once!
EDIT:
Aww, sky beat me to it xP