Multiple choice technology mainframe

In the below code, what will happen if first IF is satisfied. IF A=B NEXT SENTENCE ELSE IF C=D Move 20 to C End-If Move 40 to D End-If. Move A to B. Move C to D.

  1. (A) Control Starts after the line where, FULLSTOP is present

  2. (B) Control Starts after the line where, First END-IF is present

  3. (C) Control starts after the line where, its respective END-IF is present

  4. (D) None of the above.

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

In COBOL, NEXT SENTENCE transfers control to the first statement after the period (FULLSTOP) that terminates the current sentence. In this nested IF structure, the period after 'End-If' (the one closing the outer IF) is the sentence terminator. When A=B is true, NEXT SENTENCE jumps to 'Move A to B', skipping everything between, including the entire ELSE block and the inner END-IF.

AI explanation

Each END-IF only closes its own matching IF; it does not transfer control anywhere by itself, it merely marks the scope boundary of that conditional. After all the nested IF/END-IF blocks finish evaluating (whichever branch executed), execution simply continues on to the next full sentence, i.e., after the period following the outer statement.