What does the 'continue' statement do inside a loop? 

A

exits the loop entirely 

B

terminates the program

C

re-execute the loop twice

D

skip the rest of the current iteration and move to the next

উত্তরের বিবরণ

img

Answer: ) Skip the rest of the current iteration and move to the next
Explanation:
The continue statement in programming (C, C++, Java, Python, etc.) is used inside loops:

When the program encounters continue, it immediately skips the remaining statements in the current iteration.
Then, the loop proceeds with the next iteration (checking the loop condition for while/for loops).
 
 Example in C:
 for(int i = 1; i <= 5; i++) {
    if(i == 3) {
        continue; // skip printing 3
    }
    printf("%d ", i);
}

Output:
1 2 4 5
Notice that 3 is skipped, but the loop continues.
 
 Incorrect options:
() Exits the loop → that’s break
() Terminates the program → that’s exit()
() Re-execute loop twice → not related

Unfavorite

0

Updated: 2 days ago

Related MCQ

During a phone conversation, which mode of communication takes place? 

Created: 2 days ago

A

Simplex

B

Full-duplex

C

Half-duplex

D

Multiplex

© LXMCQ, Inc. - All Rights Reserved

Developed by WiztecBD