To prevent an infinite loop, you should always modify the ________ variable inside a while loop.

  • condition
  • counter
  • iterator
  • sentinel
To prevent an infinite loop in a 'while' loop, you should always modify the 'counter' variable. This ensures that the loop will eventually terminate when the condition becomes false, preventing it from running indefinitely.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *