C break Statement

« Previous Tutorial Next Tutorial »

In C programming, the break statement has the following two uses:

Now let's go through the following example program that illustrates the concept of break statement in C.

C break Statement Example

Here is an example program of that uses the break statement in C programming.

/* C break Statement Example
 * This program illustrates
 * the concept of break statement in C

void main()
	int i;
	int num = 2;

	for(i=1; i<50; i++)
		printf("%d * %d = %d\n", num, i, num*i);


This program prints the table of 2. Here is the sample run of this program.

c break statement

You can also use break statement in the switch statement. To see how, refer calculator program.

« Previous Tutorial Next Tutorial »