Question: Write a C program that can convert a decimal into other number bases The program first asks for a decimal integer (Enter a decimal integer:n)

Write a C program that can convert a decimal into other number bases The program first asks for a decimal integer ("Enter a decimal integer:n") The program then printout the decimal integer in base 2,8,16 format. The program will continue to ask for a binary number ("Enter a binary integer:ln" The program print out the decimal, octal, and hex value for the binary integer. Example: Enter a decimal integer: 17 *The number in octal is: 0o21 *The number in hex is: 0x11 Enter a binary integer: 10010 *The number in decimal is: 18 *The number in octal is: 0o22 *The number in hex is: 0x12 Note: You need to pad a prefix(Ob,00,0x to binary, octal, hex) when you print the value. For each output line, add a *at the beginning
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
