break

Terminates execution of the nearest enclosing do, for, switch, or while statement in which it appears.

 

#include <stdio.h>

int main( ) {
	int i = 1;

	while (i < 10) {
		printf("The value of i is now: %dn",i) ;
		i++ ;

		if (i == 5)
		break ;
	}

	return 0;
}

Leave a Reply