Multiple choice technology mainframe

Consider the following COBOL entries: 05 X PIC 99 VALUE 10. SUBTRACT 20 FROM X. The resultant value of X wil be

  1. Run time error

  2. Compilation error

  3. 10

  4. -10

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

Subtracting 20 from a PICTURE 99 variable (unsigned, holding 10) results in -10. Since the picture clause lacks a sign identifier 'S' (it is PIC 99, not PIC S99), the negative sign is dropped, leaving the value as unsigned 10. Thus, the resultant value of X remains 10.