Search

1 of 8 0-day streak

Comparisons, selection and current state

DIFFICULTYintrostandard

This is a fixed question bank. Later sets may repeat these questions

Question 1 of 8

No calculator

Initially x = 1

Each numbered row is one separate IF/ELSE decision: test its condition once using the current x, then run only the matching true or false column

The arrow ← assigns a value; = in a test checks equality without changing x. The comparisons ≤ and ≥ include equality, while < and > exclude it; ≠ means not equal

StepTest current valueIf trueIf false
1x ≥ 2x ← x + 2x ← x + 1
1 mark

What is the final value of x after all numbered decisions have run?