Question discussion

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…

359081Medium DSSSB TGT Computer Science 0 replies 0 views
0
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.
  • AOnly Q and R
  • BOnly Q
  • CP, Q and R
  • DOnly P
Correct answer: B

Explanation

In a do-while loop the body executes first and the condition is checked afterwards, and the body can contain a block of statements. Only Q is correct.

Discussion 0

Nobody has replied yet. Start the discussion!