0

Can anyone explain , how a continue statement works and what is break , what is the relation btw this two.

I'm confused

27th Jun 2020, 8:32 AM
Akhil
Akhil - avatar
2 Answers
+ 5
Akhil Nair >The break statement allows you to leave a for or while loop prematurely. >The continue statement ignores the rest of the statements inside a loop, and continues with the next iteration. 
27th Jun 2020, 8:39 AM
Indira
Indira - avatar
+ 3
*Break* statement breaks the loop(i.e. control goes outside the loop) whereas, whenever *continue* is encountered system skips that iteration and continues execution of other statements. see this code for more understanding👇 https://code.sololearn.com/c5imZISk9vV0/?ref=app
27th Jun 2020, 8:38 AM
Arsenic
Arsenic - avatar