Break & Continue

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 7

6-7 Break & Continue

Break and Continue in C Programming are control


statements.
While writing programs often time situation occurs
where we want to jump out of loop instantly without
waiting to satisfy conditional test so in such cases we
can use Break keyword.
Topics discussed in this section:
break
continue

Computer Science: A Structured Programming Approach Using C 1


FIGURE 6-20 break and Inner Loops

Computer Science: A Structured Programming Approach Using C 2


PROGRAM 6-16 How to use break statement in program

Computer Science: A Structured Programming Approach Using C 3


Output

Computer Science: A Structured Programming Approach Using C 4


FIGURE 6-21 The continue Statement
Continue is reserve keyword in C.
When continue is encountered inside any loop, control automatically passes to the
beginning of loop. 

Computer Science: A Structured Programming Approach Using C 5


PROGRAM 6-18 continue Example

Computer Science: A Structured Programming Approach Using C 6


OUTPUT

Computer Science: A Structured Programming Approach Using C 7

You might also like