In a loop of C program, ________ statement immediately exits a loop, skipping…
2023
In a loop of C program, ________ statement immediately exits a loop, skipping the rest of the body of the loop.
- A.
if
- B.
else
- C.
continue
- D.
break
- E.
Question not attempted
Attempted by 1227 students.
Show answer & explanation
Correct answer: D
In C programming, loop control statements are used to alter the normal flow of loop execution. The 'break' statement immediately exits the loop, skipping the remaining body of the loop and transferring control to the statement following the loop. The 'continue' statement skips the current iteration and moves to the next iteration of the loop. The 'if' and 'else' statements are used for conditional execution and do not control loop flow. Therefore, the statement that immediately exits a loop is 'break'.