I got this question wrong on my final..

Just wanted someone to help me understand it.....

Convert the decimal value 99 to hex digits representing the ASCII Characters for the value.


i put the letter c.... and i got it wrong.. any help?

Recommended Answers

All 3 Replies

I think you're supposed to output say 0x63 or 63h or some other variation to indicate that the representation is hexadecimal.

If it did just ask for 63 hex as an answer, "representing the ASCII characters for the value" should have been left out, which makes no sense as the decimal value 99 represents only one ASCII character.
You sure the question was worded like that?

The decimal value 99 is two ascii digits -- a '9' and another '9'. So your program has to convert the integer into two digits, then convert each digit to ascii for display.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.