PaulS:
That's because your while clause is in the wrong place.A do/while statement is fairly rare. A while statement is far more common. Unless you understand the difference, and have a good reason for using do/while, use while.
You got it to be kidding, right?
Yet another nonsense , offensive to recipient " Unless you understand the difference" , and unsubstantiated , "advise".
Perfect example for "do {process} while" is to guarantee at lest ONE pass thru the process.