There are three types of loops:
Code:
while( condition )
{
do all of this
}
This has the potential to not ever be executed, if the condition evaluates to false initially.
Code:
do
{
do all of this
} while( condition );
This loop will always execute the contents of the body of this loop at least once, even if condition evaluates false when it reaches there.
Code:
for( initializers; condition; usually-[ de ][ in ]crementing )
{
do all of this
}
This loop could also potentially never execute the body of the loop. In this loop, any or all of the elements of this loop may be left out. ( Meaning, you can not use the initialization portion, the check, or any incrementing / decrementing. They're all optional. )
These are the three standard methods of looping.
Quzah.