Day 3 Jump statements: break Statement in C Programming language
Jump Statement # break Statement
break statement is a jump statement.Break statement when encountered within a loop immediately terminates the loop by passing condition check and execution transfer to the first statement after the loop. In case of switch it terminates the flow of control from one case to another.
Syntax
break; // break statement
Example
#include <stdio.h>
int main ()
{
for (int i = 0; i<100; i++)
{
printf ("\n%d", i);
if (i == 10); // This code prints value only upto 10.
break;
}
return 0;
}