NIELIT O Level Exam

<p>What is printed?</p><pre><span style="font-size: 14px;">i = 1<br></span><span style="font-size: 14px;">while i &lt; 4:<br></span><span style="font-size: 14px;">&nbsp; &nbsp; print(i, end=" ")<br></span><span style="font-size: 14px;">&nbsp; &nbsp; i += 1<br></span><span style="font-size: 14px;">else:<br></span><span style="font-size: 14px;">&nbsp; &nbsp; print("Done")</span></pre>

What is printed?

i = 1
while i < 4:
    print(i, end=" ")
    i += 1
else:
    print("Done")


निम्न code क्या print करेगा?

i = 1
while i < 4:
    print(i, end=" ")
    i += 1
else:
    print("Done")

A. 1 2 3

B. Infinite loop

C. Done

D. 1 2 3 Done




Correct Answer is :

D. 1 2 3 Done



Explanation

The loop prints 1, 2 and 3. Since it terminates normally, the else block executes.



 Loop 1, 2, 3 print करता है और normal termination के बाद else block "Done" print करता है।

Latest Current Affairs 2026 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad