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 are initialisation, testing and execution of the body done in a do-while loop?
I. Commenting
II. Execution of the body
III. Initialisation
IV. Testing the condition

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

Show answer & explanation

Correct answer: D. III, II, IV

Explanation

A do-while runs the body once before testing: initialise → execute body → test.

More Programming Languages and Computer Graphics questions