Hello, how can I change my for loop to a while loop? I am currently on the right path I think but the first 2 iterations are not printing the correct output.
A bigger question is why you want to do this? IMO it just makes the code messier.
I find there very few situations where a do loop is actually required. It's possible to convert from any of the 3 loop statements, to any of the others. So that often means one can convert a do loop into a while loop.
for loops are good when one knows exactly how many times to loop. while loops are good when one simply has an end condition.
Just because a do loop always executes once is not sufficient reason on it's own to use them.