0
If I let the init & decrement statements empty, how does the for loop will work?!
3 Antworten
+ 1
If in your loop something else modifies the variable to the point where the condition isn't verified anymore, your loop will end at this point.
Otherwise, if the condition can never be untrue, it'll running indefinitely and you'll have a running error
+ 1
If you use only the condition check in a for loop you will have exactly the same behaviour as in a while loop... It will run until that condition if false or it will not run at all if the condition is false at the beginnig of the loop...
Hope it helped
0
thanks guys, I get it 👌