+ 2
What's different between "for" and "while"?
4 ответов
+ 5
https://www.quora.com/What-is-the-difference-between-while-loop-and-for-loop-What-is-an-example-of-this
+ 1
thanks for yours answer
0
Basically, the "while(condition){}" works all the time while the condition is true.
The "for(variable, condition, increment){}" works only a determinated time. When the loop complete a "cicle", the variable increase. When the variable reaches the condition (changing the condition to "false") the loop ends and continue with the rest of the code.