How should programmers avoid creating an infinite "while" loop?
Responses
Use a "for" loop instead of a "while" loop
Use a "for" loop instead of a "while" loop
Use the "continue" keyword as the last statement in the loop body
Use the "continue" keyword as the last statement in the loop body
Make sure your loop body will eventually make the loop's logical expression False
Make sure your loop body will eventually make the loop's logical expression False
Add an "else" statement after the end of the loop
1 answer
Add an "else" statement after the end of the loop