Interview Questions

How is sign stored in a comp-2 field?

COBOL Interview Questions


(Continued from previous question...)

How is sign stored in a comp-2 field?

It is stored in the last nibble. For example if your number is +100, it stores hex 0C in the last byte, hex 1C if your number is 101, hex 2C if your number is 102, hex 1D if the number is -101, hex 2D if the number is -102 etc ...

(Continued on next question...)

Other Interview Questions