answersLogoWhite

0


Best Answer

To input a decimal number and display in hex, something like:

char buffer[99];

fgets(buffer, 98, stdin);

printf("%x", aoti(buffer));

would be the required core code. Needless to say, there is no error checking, mug trapping, etc. Or if you require the hex in a char[], then replace "printf(" by "sprintf(pointer_to_bufffer,"

User Avatar

Wiki User

14y ago

Still curious? Ask our experts.

Chat with our AI personalities

BlakeBlake
As your older brother, I've been where you are—maybe not exactly, but close enough.
Chat with Blake
FranFran
I've made my fair share of mistakes, and if I can help you avoid a few, I'd sure like to try.
Chat with Fran
RossRoss
Every question is just a happy little opportunity.
Chat with Ross

Add your answer:

Earn +20 pts
Q: What is the C program to convert a decimal number to hexadecimal number?
Write your answer...
Submit
Still have questions?
magnify glass
imp