Illustrate the use of break and continue statement with example.
Break: It breaks the execution of the loop which allows exiting from any loop or switch, such that break statement skips the remaining part of current iterations of the loop.
Syntax: break;
Continue: It is used when it is required to skip the remaining portion of the loop without breaking loop it will transfer control directly to next iteration
Syntax: continue;
In given program sequence if “break” executes then execution control will jump out of loop & next statement after loop will be executed. In given program sequence if “continue” executes then execution control will skip remaining statements of loop & will start next iteration of loop