Break statement in is similar to that of continue statement but instead of continuing the next iteration this statement exit the current loop and start executing the next statements following the loop. But if we are in nested loop then the break statement will cause the termination of the loop in which it is contained and then continue executing the next statements after that loop.

In case of switch statement the break statement is used to terminate the case.

break-statement-in-c

Syntax for break statement in C
break;

Program of break statement

//An example of break statement in C
#include<stdio.h>

int main()
{
    int x = 10;

    for(x = 1; x <= 10; x++)
    {
        if (x == 5)
        {
            break;
        }
        printf("%d\n", x);
    }
    return 0;
}

output

1
2
3
4