Why do we use ‘break’ statement ?
Answers
Answer:
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. It can be used to terminate a case in the switch statement (covered in the next chapter).
Explanation:
Hope it helps you...
Please mark it as the brainliest answer.... :-)
The use of the ' break statement ' is described below :
- So basically break is a loop control statement used in C or C++ programming which is required for terminating the loop at the earliest.
- Break loops are mostly used in case of the nested loops where they're used to break the loops step by step , i.e , at first place inner loop is broken down and then it proceeds to break the outer loop.
- Such kind of statement is used either inside the loops or to delete the case in the switch statement.