Explain the meaning of break and continue statements??
Answers
Answered by
2
Break statement
The break statement is used with the conditional switch statement and with the do, for, and while loop statements. When a break statement is encountered inside a loop, the loop is immediately terminated and the program control resumes at the next statement following the loop.
Continue statement
Continue statement works like break but instead of forcing termination, it forces the next iteration of the loop to take place and skipping the rest of the code. Continue statement is mostly used inside loops, whenever it is encountered inside a loop, either conditionally or unconditionally, transfers control to the next iteration of either the current loop or an enclosing labelled loop.
Answered by
2
Upper answer is the correct one....
Similar questions