All mock tests are FREE till 31 December — register to save your progress
Unit 3 · Programming Languages and Computer Graphics Paper 2 CS · December 2022 (Shift 2)

In what sequence the initialization, testing and execution of body is done while using do-while loop?

I. Commenting

II. Execution of the body

III. Initialisation

IV. Testing the condition

Choose the correct answer from the following

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: D. III, II, IV

Explanation

The loop variable is initialized first; a do-while executes its body before testing the condition.

More Programming Languages and Computer Graphics questions