How many times will the loop be executed in the following flowchart?

2022

How many times will the loop be executed in the following flowchart?

{F737C914-6D3B-4358-989D-E432801B9EA0}.png

Answer: C. 2Initial value: X = 80 Check X > 0 → True → Print 80 → X = 80 − 40 = 40 Check X > 0 → True → Print 40 → X = 40 − 40 = 0 Check X > 0 → False → Loop stops So,…

  1. A.

    80

  2. B.

    1

  3. C.

    2

  4. D.

    3

Attempted by 416 students.

Show answer & explanation

Correct answer: C

Initial value: X = 80

Check X > 0 → True → Print 80 → X = 80 − 40 = 40

Check X > 0 → True → Print 40 → X = 40 − 40 = 0

Check X > 0 → False → Loop stops

So, the loop executes 2 times .

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Rssb Basic Computer Instructor

Loading lesson…