|
Notices |
![]() |
|
Thread Tools | Rate Thread | Display Modes |
![]() |
#1 |
Registered User
Join Date: Nov 2015
Posts: 127
|
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?
|
![]() |
![]() |
![]() |
#2 |
Registered User
Join Date: Feb 2016
Posts: 73
|
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. |
![]() |
![]() |
![]() |
#3 |
Registered User
Join Date: May 2015
Location: Hyderabad/Pakistan
Posts: 25
|
Basically, Break statement stop a program, and after break statement, any program does not display.
|
![]() |
![]() |
![]() |
#4 |
Registered User
Join Date: May 2016
Posts: 551
|
The break statement to end processing of a particular case
|
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Making the best thesis statement | Yemers | General Discussion | 5 | 09-13-2017 10:57 PM |
How To Choose The Right Lawyer For Your Case? | nelsontwain | Making money on the web | 1 | 12-31-2013 01:21 AM |
What’s spam indexing? | sinicline | 1 | 07-17-2013 05:24 AM | |
Looking for a new case or cover to protect your new MacBook Air? | sophia21 | General Discussion | 0 | 10-31-2012 10:52 PM |