The operator continue is used only in cycles. In cycles for , while , loop , looptime, operator continue skips the remainder of the code of the loop body and goes to the next iteration of the loop.
Example on the cycle for
In this case, both signals will sound 5 times
CODE: for (int n=0; n <5; n ++)
{
beep (1000, 100);
beep (2000, 100);
}
In this case, everything that is after continue will be skipped.
CODE: for (int n=0; n <5; n ++)
{
beep (1000, 100);
continue;
beep (2000, 100);
}
Example on the cycle while
In this case, the signal will sound five times
CODE: int n=0;
while (n <5)
{
beep (1000, 100);
n ++;
}
In this case, n ++ will be skipped and there will be a closed loop
CODE: int n=0;
while (n <5)
{
beep (1000, 100);
continue;
n ++;
}
----- The Visual Code Editor is Kibor. Creating bots without knowledge of programming.
Learning function for recognizing text.
----- |