Interview Questions

Why do we code S9(4) comp. Inspite of knowing comp-3 will occupy less space.

COBOL Interview Questions


(Continued from previous question...)

Why do we code S9(4) comp. Inspite of knowing comp-3 will occupy less space.

Here S9(4) comp is small integer, so two works equal to 1 byte so totally it will occupy 2 bytes (4 words). here in S9(4) comp-3 as one word is equal to 1/2 byte. 4 words equal to 2 bytes and sign will occupy 1/2 byte so totally it will occupy 3 bytes.

(Continued on next question...)

Other Interview Questions