Multiple choice technology programming languages

How much storage is occupied for COMP data items of 5 through 9 range

  1. 2

  2. 4

  3. 8

  4. 5

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

In COBOL, COMP (computational) data items use binary representation. For digits in the 5-9 range, the storage allocated is 4 bytes (halfword or fullword depending on implementation). This is based on the standard COMP storage allocation rules where the number of bytes depends on the expected range of values.