0
Why can't I create an infinite loop using for loop if I omit the second statement?
3 Réponses
+ 3
It's better to use the while statement if you are looking for an infinite loop.
+ 1
Yash
The second statement, is the control statement.
In other words, it's what determines whether the loop continues to run or not.
If you omit, there's nothing to check if the loop should run at all
0
Hi Yash,
Would you mind posting your code to Code Playground and linking here so we can have a better idea of what you're asking, please?