when is the while statement preferred over a for statement?
Answers
Answered by
1
Answer:
Generally, use for loops when you have a defined range of values to iterate over. Use while loops when you aren't iterating, or don't know when your exit condition will be true.
Answered by
4
Answer:
Generally, use for loops when you have a defined range of values to iterate over. Use while loops when you aren't iterating, or don't know when your exit condition will be true.
Similar questions