What is different between break and continuous conditions? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

What is different between break and continuous conditions?

14th Sep 2020, 1:49 PM
Meet Sanghani
Meet Sanghani - avatar
2 Antworten
+ 2
for(int i = 0; i < 5; i++){ if(i == 3) continue; printf(i) ; } output: 0 1 2 4 for(int i = 0; i < 5; i++){ if(i == 3) break; printf(i) ; } output: 0 1 2 "continue skips the loop, while break breaks the loop." PLEASE SEARCH BEFORE POSTING YOUR QUESTIONS NEXT TIME. https://www.sololearn.com/discuss/146640/?ref=app https://www.sololearn.com/discuss/1667598/?ref=app https://www.sololearn.com/discuss/1048680/?ref=app https://www.sololearn.com/discuss/1623411/?ref=app https://www.sololearn.com/discuss/234350/?ref=app https://www.sololearn.com/discuss/2275580/?ref=app
14th Sep 2020, 1:53 PM
Rohit
+ 1
"continue" condition skip 3 and continue printf() function "break" condition will stop when i=3 , not print.
14th Sep 2020, 2:27 PM
Ko Ko Naing