It looks like you're new here. If you want to get involved, click one of these buttons!
I've wondered ever since I started learning to code what the best kind of tasks to use the different kinds of loops for are.
What's a common situation in which it's most efficient to use a while loop? What's the best time to use a for loop?
Perhaps most importantly, when do I want to use a do-while loop instead of a while loop? I know (or at least I think) that a do-while loop will always execute at least once, whereas a while loop might not execute at all if the initial condition is not met. In what kind of situation is a do-while loop most useful?