
- C Programming Tutorial
- C - Home
- C - Overview
- C - Environment Setup
- C - Program Structure
- C - Basic Syntax
- C - Data Types
- C - Variables
- C - Constants
- C - Storage Classes
- C - Operators
- C - Decision Making
- C - Loops
- C - Functions
- C - Scope Rules
- C - Arrays
- C - Pointers
- C - Strings
- C - Structures
- C - Unions
- C - Bit Fields
- C - Typedef
- C - Input & Output
- C - File I/O
- C - Preprocessors
- C - Header Files
- C - Type Casting
- C - Error Handling
- C - Recursion
- C - Variable Arguments
- C - Memory Management
- C - Command Line Arguments
- C Programming useful Resources
- C - Questions & Answers
- C - Quick Guide
- C - Useful Resources
- C - Discussion
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
- Related Articles
- How do we use a break statement in while loop in C#?
- PHP break Statement
- Break statement in Dart Programming
- Break statement in Lua Programming
- Integer Break in C++
- What is break statement in JavaScript?
- Java break statement with switch
- What is PowerShell Break statement?
- Break a Palindrome in C++
- Minimum Word Break Problem in C++
- goto statement in C/C++
- Continue Statement in C/C++
- How to use PowerShell break statement in foreach loop?
- Continue Statement in C/C++ Programming
- Can we use break statement in a Python if clause?

Advertisements