0

loops!!

What is the differences between the loops??

20th Jan 2018, 9:17 PM
Ahmed Osama
Ahmed Osama - avatar
2 Answers
+ 1
for loops are used when it is known in advanced how many times to the loop will be run. while loop are used when the number of times to run the loop is not determined as it may vary from one instance to the next.
20th Jan 2018, 10:11 PM
Logomonic Learning
Logomonic Learning - avatar
+ 1
Aaand... while (blah) will execute the code so long as blah is true, non-zero. do ... while (blah) will execute the code at least once, even if blah is false. The there's for-loops, already explained, and goto-loops label: ... goto label These are infinite if not controlled properly, though they are the basis of all loops. if (blah) goto label as one example. Back to the other loops, there are two control mechanisms: continue - jumps back to the loop start; and break - quits the loop. There's more so checkout the lessons.
20th Jan 2018, 11:14 PM
non