Break Statement

Break Statement


By using this jumping statement, we can terminate the further execution of the program and transfer the control to the end of any immediate loop or switch body.

To do all this we have to specify a break jumping statements whenever we want to terminate from the loop.


Syntax:

break;


NOTE: This jumping statements always used with the control structure like switch case, while, do while, for loop etc.

NOTE: As break jumping statements ends/terminate loop of one level . so it is referred to use return or goto  jumping statements , during more deeply nested loops. 


Qus. 1 : What is the role of the break statement in a loop?

  1. It exits the current loop and continues with the next iteration
  2. It terminates the current loop and transfers control to the next statement after the loop
  3. It skips the current iteration and moves to the next iteration
  4. It repeats the current iteration
Qus. 2 : What is the difference between break and continue statements in loops?

  1. break stops the loop, continue skips the rest of the iteration
  2. Both stop the loop
  3. break skips to the next iteration, continue exits the loop
  4. Both skip to the next iteration
Qus. 3 : What happens if you use a break statement inside a nested loop?

  1. It breaks out of both loops.
  2. It only breaks out of the innermost loop.
  3. It causes a compile-time error.
  4. It stops the program.

Programs

c program to input any number and print its table using goto statement

View Solution


C program to input any number and print its factorial value using goto statement

View Solution


Write a program entered number check the number is even or odd by using goto statement.

View Solution


Latest Current Affairs 2025 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad