Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

what is the output for the following program? numa = 10 while numa < 21…

Question

what is the output for the following program? numa = 10 while numa < 21: numa = numa + 5 print(numa) output:

Explanation:

Step1: Initialize variable

numA = 10

Step2: First loop iteration

numA = 10 + 5 = 15 (since 10 < 21)

Step3: Second loop iteration

numA = 15+ 5 = 20 (since 15 < 21)

Step4: Third loop iteration

numA = 20 + 5 = 25 (since 20 < 21)
Now 25 is not less than 21, so the loop stops.

Answer:

25