Multiple choice technology programming languages

If you have the following declarations, what will be the content of RESULT at the end of the given instructions? DCL 1 VAR1 CHAR(5) INIT (‘PL/I’); DCL 1 VAR2 CHAR(10); DCL 1 VAR3 CHAR (2); DCL 1 RESULT CHAR (5); RESULT = ‘COBOL’; VAR2 = VAR1; VAR3 = VAR2; RESULT = VAR3;

  1. PLbbb (bbb = 3 blanco’s)

  2. COBOL

  3. COBPL

  4. PLBOL

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

VAR1 is 'PL/I' (5 chars). VAR2 receives 'PL/I' but is 10 chars, so it becomes 'PL/I ' (padded with 5 blanks). VAR3 is CHAR(2), so it receives only the first 2 characters 'PL'. RESULT, which is CHAR(5), gets 'PL' from VAR3, then padded with 3 blanks → 'PLbbb'. The variable length truncation at assignment to VAR3 is the key behavior.