Hexadecimal number system in c programming language

Hexadecimal numbering system in c programming language

In hexadecimal number system we use 16 different digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F). So, its base is 16.

Hexadecimal number chart(Table): 
   
Hexadecimal
Decimal
Binary
0
0
0000
1
1
0001
2
2
0010
3
3
0011
4
4
0100
5
5
0101
6
6
0110
7
7
0111
8
8
1000
9
9
1001
A
10
1010
B
11
1011
C
12
1100
D
13
1101
E
14
1110
F
15
1111
                           
To convert the binary number into hexadecimal number:
                    
Make the group of four binary digits from right to left put the equivalent hexadecimal digit using above table.
For example: Binary number = 11000111110101. Group of four digits from right:
    
11  0001  1111   0101

To make group of four digit of left most digit 11, add two zero to the left side i.e. 0011. Now put the equivalent hexadecimal digit form table:

0011   0001    1111  0101
 3      1       F     5

So, equivalent hexadecimal number will be 31F5

2 comments:

Anonymous said...

thanks

Anonymous said...

amazing