- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Difference Between break and continue
In this post, we will understand the difference between break and continue statements.
break
It is used to terminate the enclosing loop like while, do-while, for, or switch statement where it is declared.
It resumes control over the program until the end of the loop.
It also helps with the flow of control outside the loop.
It is used with ‘switch’ and ‘label’ since it is compatible.
Following is the flowchart of break statement −
continue
It helps skip the remaining part of the loop.
It continues to execute the next iteration.
It causes early execution of the next iteration of the enclosing loop.
It can’t be used with ‘switch’ and ‘label’ since it is not compatible.
Following is the flowchart of continue statement −
Advertisements
To Continue Learning Please Login
Login with Google