What is hexadecimal?

Hexadecimal defines a sequence of numbers centered on-16, i.e., before assigning the next number to a new location, it describes a numbering scheme that includes 16 sequential numbers as basic units (including 0). (Note that here we use “16” as a decimal number to illustrate a number which would be “10” in hexadecimal) The hexadecimal numbers are 0-9, and then A-F letters are used.

What is Binary?

Binary is a system of base number 2. Base 2 ensures that only two digits 1 and 0 correspond to states 0 and 1, which is understood by the computer can. You already know the base 10-the decimal method. Decimal uses ten digits ranging from 0 to 9 and then wraps around to form two-digit numbers, with each digit 10* times larger than the last (1, 10, 100).

Examples:

Suppose the A12C number is hexadecimal. Now the binary value of the hexadecimal number is determined.

Hexadecimal number=A12D

Binary value equal to A is 1010

Binary value equal to 1 is 0001

Binary value equal to 2 is 0010

Binary value equal to D is 1101

Therefore, the binary value equivalent to A12C is 1010000100101100.

Algorithm

We try to understand this with the help of an example.

Output:

Hexadecimal to Binary in C

Pin It on Pinterest

Share This