C program for converting hex number to decimal and character

converting hex number to binary in c
c program for hex to char
c program for converting hex to decimal

Click here to see ASCII table for hex to char

Click here to know hex to decimal converter

Logic :-

Step 1
Hex number is 21
separate high bit 2 and low bit 1

Step 2
convert 2 into binary 0010 and 1 into binary 0001
now 21 in binary is 00100001

Step 3
convert 00100001 to decimal by multiplying by power of 2
0+0+ 32+0+0+0+0+1


Main function

binarylow function

binaryhigh function


Enter Hex Number
hex 21 is in decimal is 33
hex 21 is in char is !

Enter Hex Number
hex 21 is in decimal is 76
hex 4c is in char is L

Enter Hex Number
hex 21 is in decimal is 43
hex 2b is in char is +

Click here to download this program

Leave reply

Add your comments here

Back to Top