Not just look at your statement which is similar to a vague statement a continual statement is used 2
with only loops that is either with furler. 3
Why not. 4
Or do I look so unlike break. 5
It's not used with a switch statement. 6
And as the names are just a continual statement continues with the next iteration of the innermost loop 7
on any statements immediately following it are not executor so well a big statement is used to break 8
out of the innermost loop a continual statement is used to continue with the innermost true here's an 9
example the continue statement is used in a while statement typically as shown here continue would be 10
engrossed in an IF statement so then continue stateman gets executed. 11
The rest of the why loop escape and we continue with the next iteration with the condition expression 12
is evaluated. 13
Not this book it can be a statement in a fuddle hit as soon as the continue statement is encountered 14
the rest of the for loop is good. 15
And then any expressions in the expression this study evaluated only after that the condition expression 16
is evaluated. 17
We know that this is how a for loop cycle normally books on it is no different when a continuous treatment 18
is involved. 19
Here's an invalid example which is similar to the one we saw when discussing break. 20
It gives a compiler as there is no and closing look. 21
Like in the case of a break statement there is actually a label can be in your statement which is very 22
useful when dealing with nested loops husbandly to label the loop which we want to continue read for 23
this we have the label name followed by a colon which is in turn followed by a loop statement like a 24
for a while next somewhere within that loop we can have a label can in your statement. 25
Well the key word continue is followed by the label name know I want to highlight a difference between 26
label break a label continue here we continue. 27
The label is associated with only an end closing loop statement like a fire Otterbein hover over the 28
break statement. 29
The label can be associated with any block statement number block statement can also be an if statement 30
so it means that labels continue cannot be used with an if statement. 31
Here it is called on the left use label break and the label is associated with an if statement and it 32
is perfectly valid. 33
Whereas on the right is an example of often label continue and we get a compiler error at the continue 34
statement as the label it uses is associated with an if statement rather than an enclosing local not 35
lost your shot them off label continue. 36
The code is very similar to the Corbie software and they will bring a new medical label continue has 37
been added but the basics democracy. 38
Let's look at the code. 39
Now OK here is the new method label continue. 40
And as you can see it is very identical to the label brick method which we have seen in the break statement 41
. 42
OK so we have the same number variable initialized to zero and we have the nested for loop and we have 43
the same if condition our number is getting incremented here and we are printing it here pending the 44
final value of. 45
And we have the same label outermost. 46
And the only difference the only difference here is that we how this statement continues. 47
So the break statement the label break has been replaced with a label continue. 48
That's the only difference even the condition is also seen. 49
OK so here we are initialising number zero and up within the nested for loop. 50
Each nested For each for loop is iterating 14 times. 51
And here the condition is if I equals five and Jake was five in that case we are going to continue with 52
the outermost loop. 53
OK. 54
So normally this would in a for loop What did it for 100 times. 55
But when I is equal to 5 then we are in J's equal to 5 then we are skipping the last five iterations 56
of the innermost loop and we are just continuing with the next iteration of the outer outer most for 57
low. 58
OK. 59
So we are just keeping the five five iterations here. 60
One is equal to five and J is equal to five which means that we are skipping Jake will do 5 6 7 8 and 61
9. 62
OK. 63
Five of them sort of hundred hundred iterations we are skipping five and so numb would be incremental 64
to 95. 65
So they know for loop isn't rim is it rating for 95 times. 66
OK so let's just go ahead and run it. 67
It's already compiled as you can see it is printing 95 so that's about labeled on Daneel statement. 68
OK. 69
Know you can also find this program in the resource section. 70
OK. 71
Thank you. 72
And happy coding.