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
- Assertion A: A Raster scan device is a CRT graphic device and can use a television monitor for display Reason R: In Raster scan display the…
- The hidden surface removal problem with a minimal 3D pipeline can be solved with
- The transformation [x̄ ȳ z̄ w̄]ᵀ = [a1 b1 c1 d1; a2 b2 c2 d2; a3 b3 c3 d3; e f g h] · [x y z 1]ᵀ is called
- Of the following, which is NOT a logical error?
- Which statement is false?
- What does the following C function f() return? int f(unsigned int N) { unsigned int counter = 0; while (N > 0) { counter += N & 1; N = N >>…