At Wednesday 11/14/2007 09:54 PM, you wrote:
>hi to all,
>   am very new to the c -languge.
>   how to convert hexadecimal to binary in c-langugae.
>   any body send the source code...
>
>   Regards,
>   Rajesh.

Your request is a bit unclear. Numbers (data in general) are stored 
in a computer's memory as binary values.
Do you want to convert the DISPLAY of a number from one format to 
another? Or take a display (in hexadecimal representation) of a 
number and convert it to a binary number?

Hexadecimal "digits" range from 0-F, or 0-15; 0 - 9 plus A=10, B=11, 
C=12, D=13, E=14 and F=15.

So hexadecimal 05 equals 5, hexadecimal 0F equals 15, hexadecimal 10 
would equal decimal 16. ((16 * 1) + 0). Hexadecimal F2 equals 
((15*16) + 2) or decimal 242.

So, walk through the digits and multiply it by its' units value 
(0-15), (16-255), (256-2047), etc.

If you want to actually display the digits in binary, you need to 
determine the value of each bit in the number. Step through the bits, 
and print a '0' or '1' based on the bit value.

Hexadecimal F2 would be '11110010'

~Rick

>
>---------------------------------
>Be a better sports nut! Let your teams follow you with Yahoo Mobile. 
>Try it now.
>
>[Non-text portions of this message have been removed]
>
>
>
>To unsubscribe, send a blank message to 
><mailto:[EMAIL PROTECTED]>.
>Yahoo! Groups Links
>
>
>

Reply via email to