/Decimal-to-Binary

C++ program that converts a decimal value from -128 to 255 in binary.

Primary LanguageC++

Decimal-to-Binary

C++ program that converts a decimal value to binary.

Specifics: Converts a decimal value within the range of -128 to 255 to an 8-bit binary number. The program will create both 8-bit unsigned and 8-bit 2's complement representations of the decimal number.

For numbers in the range of -128 to -1, the program will display the 2's compliment representation and label it as "2's complement".

For numbers in the range of 0 to 127, the program will display the 8-bit representation and label it as "both unsigned and 2's complement".

For numbers in the range of 128 to 255, the program will display the unsigned representation and label it as "unsigned".

Values outside of this range will display "out of range" and the program will be terminated.