English

How many times are the following loop executed? i=2 while (i<=25) print i

Advertisements
Advertisements

Question

How many times are the following loop executed?

i=2
while (i<=25)
       print i
Very Short Answer
Advertisements

Solution

Since the value of i is never changed, i always remains 2 and the condition i <= 25 is always true.

Infinite times (Infinite loop)

shaalaa.com
  Is there an error in this question or solution?
Chapter 1: Review of Phython - EXERCISE [Page 25]

APPEARS IN

CBSE Computer Science with Python [English] Class 12
Chapter 1 Review of Phython
EXERCISE | Q 4. e) | Page 25
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×