Which of the following statements about do-while loop in C program is/are correct?
Which of the following statements about do-while loop in C program is/are correct?
P: In do-while loop, first the condition is evaluated and then the statements are executed.
Q: In do-while loop, firstly the statements inside loop body are executed and then the
condition is evaluated.
R: The body of the do-while loop cannot contain a block of statements.
Show answerHide answer
Correct answer: (B) Only Q
Explanation
A do-while loop runs its body first and then tests the condition, so Q is true and P is false. R is false because the body can be a block in braces.