Question: Regarding decisions about which type of loop to useif you know your loop will always be executed at least once, then do. . .while is
Regarding decisions about which type of loop to use—if you know your loop will always be executed at least once, then do. . .while is a good option.
When a numeric variable is being changed by a consistent amount with each iteration through the loop, the for statement might be the best option. The while statement can be used to write any type of loop.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
