Difficulty: Medium
Correct Answer: 11
Explanation:
Introduction / Context:
Classical FORTRAN provides a computed GO TO statement for multi-way branching: GO TO (L1, L2, …, Ln) k transfers control to the k-th label in the list. Understanding the indexing behavior is essential for reading legacy scientific code.
Given Data / Assumptions:
Concept / Approach:
Evaluate JCOKE after the increment, then index into the label list. Out-of-range indices typically fall through (implementation dependent), but here the index is within the valid range 1..8.
Step-by-Step Solution:
Verification / Alternative check:
Trace as if it were an array: labels[4] = 11. This matches standard FORTRAN behavior.
Why Other Options Are Wrong:
Common Pitfalls:
Assuming zero-based indexing; forgetting the prior increment of JCOKE; miscounting label positions.
Final Answer:
11
Discussion & Comments