What is the difference between break and continue statements in C language?
A. break terminates the loop or switch statement and continue skips the current iteration of the loop
B. break skips the current iteration of the loop or switch statement and continue terminates the loop
C. break and continue both terminate the loop or switch statement
D. break and continue both skip the current iteration of the loop or switch statement.
Answer:A
What is the difference between break and continue statements in C language?
A. break terminates the loop or switch statement and continue skips the current iteration of the loop B. break skips the current iteration of the loop or switch statement and continue terminates the loop C. break and continue both terminate the loop or switch statement D. break and continue both skip the current iteration of the loop or switch statement.
Explanation: The control statements break and continue are used to change the loop's or switch's direction of execution. Break signals the end of a loop or switch statement and moves control to the statement that follows. Break, for instance, can be used to end a loop when a specific requirement is satisfied. continue instructs the loop to skip the current iteration and move on to the following one. Continue, for instance, can be used to skip some loop iterations based on a condition.