+ 1
What is the purpose of using break statement and continue statement
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
+ 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.
0
break; it exit it from the looping process.
continue; it takes to the next begining of the statement.