Introduction
We use loops to repeat actions. while and do-while loops help us repeat code, but they check the condition at different times.
When you want to repeat something only if a condition is true before starting.
When you want to run a block of code at least once, then repeat if a condition is true.
When you are reading user input and want to validate it before repeating.
When you want to keep asking for a password until it is correct, but show the prompt at least once.