what is use of break statement in C++ program?
Answers
Answered by
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
Social Sciences,
6 months ago
English,
6 months ago
Math,
6 months ago
Social Sciences,
1 year ago
Biology,
1 year ago