What will be the output of the following program

A. What will be the output of the following program?

 

i = 1

for x in range(1,4):

for y in range(1,3):

i = i +(i * 1)

print(i)

a. 32                b. 62

c. 63                 d. 64

B. What will be the output of the following program?

count = 0

for x in range (1,3):

for y in range (4,6):

count = count + (x * y)

print (count)

a. 32           b. 27

c. 57            d. 64

C. What will be the output of the following program?

i = 0

for x in range (1,3):

j = 0

for y in range (-2,0):

j = j + y

i = i + j

print (i)

a. 10 b. –10

c. 0 d. None of the above

D. By default, while is:

a. Condition control statement             b. Loop control statement

c. Both a and b                                      d. None of the above

E. What will be the output of the following program?

Count = 0

num = 10

while num > 8:

for y in range(1,5):

count = count + 1

num = num – 1

print(count)

a. 10           b. 8

c. 12           d. 11

 

Leave a Reply

Your email address will not be published.