Multiple choice technology mainframe

What is the content of RESULT after execution of the following COBOL instruction. The start value of RESULT is 0. PERFORM VARYING C FROM 1 BY 1 UNTIL C = 6 COMPUTE RESULT = RESULT + 1 END-PERFORM

  1. 4

  2. 5

  3. 6

  4. 7

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

The PERFORM VARYING loop executes with C starting at 1 and incrementing by 1 until C reaches 6. This means the loop runs when C = 1, 2, 3, 4, 5 (5 iterations total). Each iteration increments RESULT by 1, starting from 0, so the final value is 5. The loop stops before executing when C = 6.