Either submit the source code files (.cpp) on Ecampus under the "Submit Homework" menu option.

Using C++, write a program that converts an integer to 32-bit signed magnitude, and two's complement.  Add a space between every 8 bits.  Do not use external libraries that provide the calculations automatically.

Example output
This program converts an integer to 32-bit signed magnitude and two's complement.

Enter an integer: -255

Signed magnitude: 10000000 00000000 00000000 11111111
Two's complement: 11111111 11111111 11111111 00000001

Enter an integer: 15

Signed magnitude: 00000000 00000000 00000000 00001111
Two's complement: 00000000 00000000 00000000 00001111