Multiple choice technology mainframe

A = 0, B = 9….. Perform until a > b Add 2 to a End-perform How many additions are performed?

  1. 3

  2. 4

  3. 5

  4. 6

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Starting with A=0, the loop adds 2 to A in each iteration until A > 9. The values of A will be 2, 4, 6, 8, and finally 10. This requires exactly 5 additions.