+ 1

What is the purpose of using break statement and continue statement

2nd Mar 2017, 6:32 PM
Yashasvi Rastogi
Yashasvi Rastogi - avatar
4 Antworten
+ 12
break: exits the loop (in switch statement doesn't execute the following cases) continue: continues with the next iteration of the loop
2nd Mar 2017, 8:13 PM
Tashi N
Tashi N - avatar
+ 3
Break is a jump statement, it allows the compiler to skip the code whenever we want. And continue statement is simply use to continue the Code again.
3rd Mar 2017, 2:00 AM
Akash Kumar Sharma
Akash Kumar Sharma - avatar
0
break; it exit it from the looping process. continue; it takes to the next begining of the statement.
3rd Mar 2017, 2:08 AM
Ashutosh Kumar
Ashutosh Kumar - avatar