Multiple choice technology mainframe

Formula for calculating bytes required for COMP-3 variable

  1. N/2 + 1

  2. N^2 + 1

  3. N+1/2

  4. (N/2)^2

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

COMP-3 (packed decimal) stores 2 decimal digits per byte, plus a sign nibble. For N digits, you need ceiling(N/2) bytes for the digits plus 1 byte for the sign, which rounds to (N/2) + 1. Options B, C, and D use incorrect mathematical operations that don't match packed decimal storage requirements.