Question: Program language: C Program used: putty Your program should convert an integer into another base. The input integer could be in binary, decimal, octal or

Program language: C

Program used: putty

Your program should convert an integer into another base. The input integer could be in binary, decimal, octal or hexadecimal. The output could be converted into any of the bases (except for binary). A sample run is below. The users response is in boldface. Note that if the input is in binary, you must read it in as a string and convert it to the output base. I am not requiring you to output numbers in binary.

Base of input integer: Enter b for binary, d for decimal, h for hexadecimal or o for octal: d

Enter the number: 178

Enter the base of the output (d, h or o): h

The integer 178 in decimal is b2 in hexadecimal

Do you wish to do another? (Y or N): Y

Base of input integer: Enter b for binary, d for decimal, h for hexadecimal or o for octal: o

Enter the number: 423

Enter the base of the output: d

The integer 423 in octal is 275 in decimal

Do you wish to do another? (Y or N): N

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!