while condition isnt the same as do while condition. in the do while case the code gets executed at least once.
–
mat kelceyOct 10 '08 at 9:22

1

The point of the question was that it's obvious how to do a while (condition){...} but not so obvious how to do a do{...} while(condition), which runs the inside block at least once no matter what.
–
Cristi DiaconescuOct 10 '08 at 14:08