What is the use of a break statement in c?
Question: What is the use of a break statement in c?
In C programming, a break statement is used to exit a loop or switch statement before its normal completion. When the break statement is encountered within a loop, the program will immediately exit the loop and resume executing the next statement after the loop. When used within a switch statement, the break statement is used to exit the switch block and resume executing the next statement after the switch.
The break statement is a crucial control statement in C programming, as it enables programmers to break out of loops or switch statements when certain conditions are met, improving the efficiency and functionality of the code.
0 Komentar
Post a Comment