Multiple choice technology mainframe

The COBOL perform loop is the equivalent of which of the following structures found in other languages such as Java or C++

  1. For loop

  2. Do-While loop

  3. Method

  4. All of the above

  5. None of the above

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

The COBOL PERFORM loop with the UNTIL clause executes the paragraph at least once and then tests the condition, which is the same behavior as a do-while loop in Java or C++. A for loop typically initializes and tests before execution, and a method is a completely different construct (a subprogram, not a loop).