while Loop

// prototype
// while (expression) { statement; }

The while loop tests expression and executes the statements repeatedly as long as expression is TRUE.

If the expression evaluates to FALSE at the beginning of the while loop's execution then the statements are skipped over entirely.

int i;
while (i < 5) 
{
     // statements ...
     i++;
}




 author: Ryan Hunt, editors: Charles Feduke, Mistress, contributor: Ken Cotterill