---
title: 2.16 break Statement
description: "The `break` statement immediately terminates the nearest enclosing loop. Control continues with the statement following that loop. ``` #include int main() { int i; for (i = 1; i"
url: "https://edcret.in/docs/c-programming/control-flow/2-16-break-statement/"
updated: "2026-09-06"
category: C Programming / Control Flow
---

# 2.16 break Statement

The `break` statement immediately terminates the nearest enclosing loop. Control continues with the statement following that loop.

```
#include <stdio.h>

int main()
{
    int i;

    for (i = 1; i <= 10; i++)
    {
        if (i == 6)
        {
            break;
        }

        printf("%d\n", i);
    }

    return 0;
}
```

### Example Output

```
1
2
3
4
5
```

### Explanation

The `for` loop normally continues until `i` becomes greater than `10`.

When `i` reaches `6`, the condition inside the `if` statement becomes true:

```
if (i == 6)
{
    break;
}
```

The `break` statement immediately terminates the `for` loop. Therefore, `6` and the remaining values are not printed.

`break` affects only the **nearest enclosing loop or `switch` statement**.
