🚀 Hurry! Offer Ends In
00 Days
00 Hours
00 Mins
00 Secs
Enroll Now
X

निम्नलिखित प्रोग्राम का आउटपुट क्या है:

What is the output of the following program:

i = 0
while i < 3:
      print (i) 
      i=i+1 
      print (i+1)
A)
B)
C)
D)

Explanation:

The code prints two numbers in each loop iteration: the current value of i and i + 1.

  • First, i = 0 → prints 0 and 2
  • Then, i = 1 → prints 1 and 3
  • Finally, i = 2 → prints 2 and 4

So, the output is 0 2 1 3 2 4.

The correct answer is (A) 0 2 1 3 2 4.

Latest Updates