0
Where is the difference between a for and a while loop?
i tested it and so far I can see that the for loop is starting with the given value and the while loop is incrementing by one and then outputting it. Please excuse if this should be clear by now
2 Answers
+ 1
in certain case when you use while, you dont know when the loop will stop, you only know, that if the condition turns false, it has to stop. with for loop you know exactly how many times it will execute. i hope it helps
0
@Benedek Måté Tóth it does indeed make it clearer. Thanks a million



