Difficulty: Medium
Correct Answer: 103
Explanation:
Introduction:
This problem checks knowledge of the classic Fortran arithmetic IF statement and evaluates control flow based on the sign of an expression. Understanding how labels are chosen for negative, zero, or positive results is the key concept.
Given Data / Assumptions:
Concept / Approach:
In Fortran's arithmetic IF, the control transfers to the first label if the expression is negative, to the second label if the expression is zero, and to the third label if the expression is positive. So we compute the expression and then select the corresponding label to update JCOKE.
Step-by-Step Solution:
Verification / Alternative check:
Check other branches to ensure they do not apply: zero would go to label 6, positive to label 7. Because -28 is negative, label 5 is uniquely correct.
Why Other Options Are Wrong:
106 – corresponds to label 6 (zero case), not applicable. 109 – corresponds to label 7 (positive case), not applicable. 'none of the above' – incorrect because 103 matches label 5.
Common Pitfalls:
Misremembering arithmetic IF semantics; performing operations in the wrong order; treating arithmetic IF as logical IF.
Final Answer:
103
Discussion & Comments