- 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
Break Statement in C/C++
Break statement is also a loop control statement. It is used to terminate the loop. As the break statement is encountered, the loop stops there and execute the next statement below the loop. It is also used in switch statement to terminate the case.
Here is the syntax of break statement in C language,
break;
Here is an example of break statement in C language,
Example
#include <stdio.h> int main () { int a = 50; while( a < 60 ) { if( a == 55) { break; } printf("Value of a: %d\n", a); a++; } return 0; }
Output
Value of a: 50 Value of a: 51 Value of a: 52 Value of a: 53 Value of a: 54
Advertisements