← All questions
RareComputer science

What value of D does the flowchart output for A = 11, B = 10, C = 12?

Short answer
100

Exercise

What value of D does the flowchart output for A = 11, B = 10, C = 12?

Solution

11 > 10 ✓ → 10 > 12 × → D = 10² = 100

Begin at the first decision. Eleven exceeds ten, so the branch asks whether ten exceeds twelve. This second answer is false, leading to the instruction that squares B. A and C select the route; neither contributes a factor to the multiplication.

A = 11, B = 10, C = 12. (A > B) = (11 > 10) = 1. (B > C) = (10 > 12) = 0. D = B × B = 10 × 10.

Trace the instructions in order. A test reads the current values, an assignment replaces a value, and output uses the value present when execution reaches it. Recording each new state makes the result checkable.

Conditionals

Platforms

  • MAXIMUM

Download now and try it for free on your own tasks!

10 15 free credits • No credit card required
Version: Loading…

Choose the Windows app or the Chrome extension with phone controls.