Break Statement in C

Prev Tutorial Next Tutorial

Break Statement in C

Break statement are used for terminates any type of loop e.g, while loop, do while loop or for loop. The break statement terminates the loop body immediately and passes control to the next statement after the loop. In case of inner loops, it terminates the control of inner loop only.

Use break statement

Break statement are mainly used with loop and switch statement. often use the break statement with the if statement.

  • with loop statement
  • with switch case
  • with if statement


jump-statements (loop or switch case);

Example of break


void main()
char key;
printf("Press any key or E to exit:\n");
scanf("%c", &key);
if (key == 'E' ||  key == 'e')
printf("Good bye !\n");

Explanation:In the above code when user enter any character, if the user enters E or e, the break statement terminates the while loop and control is passed to the statement after the while loop that displays the Good bye !message.


Press any key or E to exit
Good bye !

Prev Tutorial Next Tutorial

Download Projects

Google Adsense Advertisements
Free Classified Site – Bedpage

Yahoo Advertisements