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, B=9, the loop PERFORM UNTIL A>B executes while A<=9. A increments by 2 each iteration: 0, 2, 4, 6, 8, 10. The condition A>B becomes true when A=10. The loop runs for A=0,2,4,6,8 - that's 5 additions.