Multiple choice technology mainframe

If you need performance which is the best for your array variable

  1. Using Index to access

  2. Using subscript to access

  3. Both a and b

  4. None of the above

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

The correct answer is A (Using Index to access). In COBOL and similar languages, accessing array elements using an index is more efficient than using subscripts. Indexes use binary addressing and direct memory access, while subscripts may require additional calculations or conversions. For performance-critical code involving repeated array access, index-based access is the preferred method.