Continue statement | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Continue statement

Please I try playing around with the CONTINUE STATEMENT... It works by giving me d opposite of what the loop condition is supposed to give... Is that the work of CONTINUE STATEMENT???

12th Dec 2016, 6:46 PM
Tukele Osareme C
Tukele Osareme C - avatar
4 Answers
+ 4
continue simply skips the code that follows it in the current loop iteration for example, you want to do some operations on data that is on array, execpt for specific indexes or for specific known data. by using a simple if condition which capture that certain index or indexes, and using the continue, the loop will immedietly advance for the next cycle. an alternative will be to do: if(something i wanna skip){ } else{ do all the other stuff i DO NOT want to skip } TL;DR continue will SKIP whatever follows it inside a loop and contine to the next loop iteration
12th Dec 2016, 7:35 PM
Burey
Burey - avatar
+ 4
np ^^
12th Dec 2016, 7:45 PM
Burey
Burey - avatar
0
Thanks alot bro
12th Dec 2016, 7:44 PM
Tukele Osareme C
Tukele Osareme C - avatar
0
Nice thx
19th Jan 2017, 6:45 AM
Rafael Grzonka
Rafael Grzonka - avatar