![]() |
What’s the purpose of using Break in each case of Switch Statement?
What’s the purpose of using Break in each case of Switch Statement?
|
Break is used after each case (except the last one) in a switch so that code breaks after the valid case and doesn’t flow in the proceeding cases too.
If break isn’t used after each case, all cases after the valid case also get executed resulting in wrong results. |
Basically, Break statement stop a program, and after break statement, any program does not display.
|
The break statement to end processing of a particular case
|
All times are GMT -7. The time now is 09:46 AM. |
Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.