Computer Science, asked by harsimar5544, 5 months ago

Read the code snippet
i=3

while(i>0):

i=i-1
Based on the code above, How many times will the loop run

Answers

Answered by roysen1992
0

Explanation:

The output will be

3

2

1

Hence we can say the loop.runs 3 times that is till the value of i is greater than 0. When I =0 and its not more than zero obviously,the loop terminates then and there.

Similar questions