Break Statement in C - c break



 Break Statement in C

Learn c - c tutorial - Break Statement in C - c examples - c programs

Break Statement in C

  • The loop is immediately terminated and the program control resumes at the next statement following the loop is known as Break statement is encountered within a loop.
  • It is used to terminate a case in the switch statement.
 Break Statement in C

Learn c - c tutorial - Break Statement in C - c examples - c programs

Sample Code

#include <stdio.h>
int main()
{
    int loop; //loop counter
    for(loop=1; loop<=10; loop++)
    {
        if(loop==7)
        {
            printf("break...\n");
            break;
        }
        printf("%d\n",loop);
    }
    printf("BYE BYE!!!\n");
    return 0;
}

Output

1
2
3
4
5
6


View More Quick Examples


Related Searches to Break Statement in C - c break