Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

13) what will the value of the variable bags be at the end of the flowc…

Question

  1. what will the value of the variable bags be at the end of the flowchart shown here? var apples = 10 var oranges = 5 var bags 1 2 3 4

Explanation:

Step1: Calculate apples + oranges

$apples = 10$, $oranges = 5$, so $apples + oranges=10 + 5=15$.

Step2: Check first condition

First condition: $apples + oranges>20$? $15>20$ is false.

Step3: Check second condition

Second condition: $apples + oranges>15$? $15>15$ is false.

Step4: Check third condition

Third condition: $apples + oranges>10$? $15>10$ is true. So $bags = 2$.

Answer:

2