Multiple choice technology programming languages

A PL/I programmer wants to display a number in his/her program. Which of the following variables is suited for doing this ? +123.45 (we assume the decimal sign is ‘.’)

  1. PIC ‘(5)9’

  2. PIC ‘S(3)9V.99’

  3. PIC ‘S999.99’

  4. PIC ‘999V99’

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

To display the value +123.45 with a decimal sign and support a sign, three integer digits, a decimal point, and two fractional digits, the picture clause PIC S999.99 is appropriate. The S indicates a sign, 999 handles the whole number part, and .99 handles the decimals.