What method does the int datatype use for storing negative numbers?

KellyPoima

New member
What method does the int datatype use for storing negative numbers?
A. 1’s Complement
B. 2’s Complement
C. 3’s Complement
D. 4’s Complement
 
Answer: B
Explanation: The int datatype stores 16 bits of data. The way it handles negative numbers is by a method called the 2’s complement wherein a sign bit is added to the binary equivalent of the number and then all the bits are inverted and then added by one.
 

Tìm kiếm

Back
Top