CBSE Class 11 Computer Science Question 100 of 161

Flow of Control — Question 9

Back to all questions
9
Question

Question 9a

Rewrite the following code fragment using for loop:

i = 100
while (i > 0) :
    print (i)
    i -= 3

Answer

for i in range(100, 0, -3) :
    print (i)
Answer