Sample code for while loop with break statement in a C program:
What will be the output of this below program?
printf ("%d\n", i ) ;
it prints from 1 to 5. once it reaches 5 we are breaking from while loop so it comes out of while loop with out executing rest of the iterations. Break statements are used to break out of an iteration statement or out of a switch statement.
Back To Top