Computer Science, asked by lalit7898, 10 months ago

what is use of break statement in C++ program?​

Answers

Answered by charlie1505
1

Answer:

The break statement has the following two usages in C++ −

When the break statement is encountered inside a loop, the loop is immediately terminated and program control resumes at the next statement following the loop.

It can be used to terminate a case in the switch statement

If you are using nested loops (i.e., one loop inside another loop), the break statement will stop the execution of the innermost loop and start executing the next line of code after the block.

Syntax

break!;

Similar questions