Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

question # 3 multiple choice what is the output of the following progra…

Question

question # 3
multiple choice
what is the output of the following program?
numa = 2
while numa < 30:
numa = numa * 5
print(numa)
50
30
10
12

Explanation:

Step1: Initial value assignment

numA = 2

Step2: First - iteration check

The condition numA < 30 is true as 2 < 30. Then numA = numA 5=2 5 = 10.

Step3: Second - iteration check

The condition numA < 30 is true as 10 < 30. Then numA = numA 5=10 5 = 50.

Step4: Third - iteration check

The condition numA < 30 is false as 50>30, so the loop stops and the value of numA which is 50 is printed.

Answer:

50