40000(10) = 9C40(16) = 1001110001000000(2)
Chat with our AI personalities
signed: its value can be less than zero unsigned: its value cannot be less than zero example: 16 bit signed: -32768 .. 32767 16 bit unsigned: 0 .. 65535
In unsigned notation, 0xFFFF (65,535 decimal) is the largest value that will fit in a 16-bit register. In signed notation, 0x7FFF (32,767 decimal) is the largest because the most-significant bit denotes the sign.
hexadecimal can express 16 bit binary in 4 place form, not 16.
16 is the 4th power of 2. So a hexadecimal number is converted to binary by replacing each hex digit by the 4-bit binary number having the same value. Conversely, in converting binary to hexadecimal, we group every 4 bits starting at the decimal (binary?) point and replace it with the equivalent hex digit. For example, the hexadecimal number 3F9 in binary is 1111111001, because 3 in binary is 11, F (decimal 15) is 1111, and 9 is 1001.
Consult your limits.h and math.h. For char it will be -128..127 or 0.255 (signed and unsigned).