Break Continue statements in C

Repeatedly execute a block of code using the loop control statements. The following are the loop control statements in C Language:

  • break statement
  • continue statement

break Statement

Use the break statement, if you want to jump out of a loop. The control passes to the first statement after the loop, since the break statement terminates the loop.

The syntax for break statement:

Example

The following is an example showing the usage of the break statement in C language,

The following is the output showing the usage of the break statement in C Language,

C Programming break statement

continue statement

Use the continue statement, if you want to pass control to the next iteration of the loop. However, it skips any code in between.

The syntax for continue statement in C language,

The following is an example showing the usage of the continue statement,

The following is the output,

C Programming continue statement

In this lesson, we learned how to work with loops in C Language. We saw the implementation of the while loop, do-while loop, for loop, break statement, and continue statement.

If you liked the tutorial, spread the word and share the link and our website Studyopedia with others:


For Videos, Join Our YouTube Channel: Join Now


Read More:

C Tutorial | Learn C Programming
Loops in C Programming
Studyopedia Editorial Staff
contact@studyopedia.com

We work to create programming tutorials for all.

No Comments

Post A Comment

Discover more from Studyopedia

Subscribe now to keep reading and get access to the full archive.

Continue reading