ExamVeda
Login
Home
This question belongs to C Program Control Structures
Control Structures
?

How many times will a 'do-while' loop execute its body if the condition is initially false in C?

Answer & Solution
Correct Answer: Option B
In C, a do-while loop executes its body at least once, even if the condition is initially false. This is because the condition is evaluated after the body of the loop has been executed. If the condition is false after the first execution of the body, the loop terminates. Therefore, even if the condition is initially false, the loop body will execute once before the condition is evaluated.

So, the correct answer is Option B: 1 time.
Examveda
Question posted by Examveda
Community

Join the Discussion

1 Comment
Anusree K
Anusree K 2 years ago
i think the code will execute once