The document discusses the break and continue statements in C programming. Break is used to immediately exit a loop without checking conditional statements, while continue skips the rest of the current loop iteration and proceeds to the next one. Examples are given showing the use of break to exit inner loops and continue to skip printing even numbers in a for loop.
The document discusses the break and continue statements in C programming. Break is used to immediately exit a loop without checking conditional statements, while continue skips the rest of the current loop iteration and proceeds to the next one. Examples are given showing the use of break to exit inner loops and continue to skip printing even numbers in a for loop.
The document discusses the break and continue statements in C programming. Break is used to immediately exit a loop without checking conditional statements, while continue skips the rest of the current loop iteration and proceeds to the next one. Examples are given showing the use of break to exit inner loops and continue to skip printing even numbers in a for loop.
The document discusses the break and continue statements in C programming. Break is used to immediately exit a loop without checking conditional statements, while continue skips the rest of the current loop iteration and proceeds to the next one. Examples are given showing the use of break to exit inner loops and continue to skip printing even numbers in a for loop.
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