i am receiving number from ADC naturally its in the form of hex,but i need display it as decimal so its need conversion or any other method pls help me
You don't mention what chip you have but there is normally not anything "hex" about the value you get from an ADC - it's normally a number of bit positions in a register that stores a value.
When presenting a value, it's possible to decide on binary, octal, decimal, hexadecimal or any other suitable numeric base to use.
What issues do you see with displaying the value you get from the ADC compared to printing the numeric value 1 or the numeric value 193? Do you think a function like sprintf() care about where you got the number?
And you don't understand how to do division by ten? That would seem a bit career limiting.
You want ASCII output? itoa() www.cplusplus.com/.../
As I'm not aware of an ADC that generates "hex", going to assume it's a binary integer of 12-16 bits width.
i am using at89s52, ADC output in the form of bits ok, its 8bit ADC means it stores 0x00 to 0xFF in register, my ADC is connected to temp sensor,but i want display values in degrees
"my ADC is connected to temp sensor,but i want display values in degrees"
So what is stopping you? You have studied the datasheet for the temperature sensor?
sensor is connected to ADC its gives 8 bit output, that 8 pins is connected to uc port, so it stores 00 to FF,now i am doing some calculation but its in hex now u can understand my problem sir
No. Your calculations is most definitely not in hex. Hexadecimal is a numeric base and happens when you want to represent a number. Before you represent it, the number has no numeric base.
It's irrelevant that the processor internally represent numbers in binary - to your code, they are just numbers. If a datasheet says 0x00 - 0xff or if it says 0 - 255 doesn't matter. That is just a representation of the number - 0xff or 255 or 0377 or 0b11111111 is still the same value. This is similar to how one liter of water is the same amount of water even if you call it 10dl or 100cl or 0.001m3 or 35.1951oz or 0.22gal.
So stop being so totally locked up on what numeric base a value is presented in.
What is your temperature sensor and what is the value of the ADC's reference voltage?