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. None of the above

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

COBOL's PERFORM...UNTIL executes the loop body first, then checks the condition - similar to do-while in Java/C++ (condition checked at bottom, guaranteed at least one iteration). PERFORM...VARYING is more like a for loop.