C examples for Statement:for
The break statement causes the loop to exit and executes the statement after for loop.
#include <stdio.h> int main()// ww w.jav a2 s . c o m { int x; for ( x = 10; x > 5; x-- ) { if ( x == 7 ) break; } printf("\n%d\n", x); }