Given a Hexadecimal number as an input, the task is to convert that number to Binary number.
Input: Hexadecimal = 1AC5 Output: Binary = 0001101011000101 Explanation: Equivalent binary value of 1: 0001 Equivalent binary value of A: 1010 Equivalent binary value of C: 1100 Equivalent binary value of 5: 0101 Input: Hexadecimal = 5D1F Output: Binary = 0101110100011111
Approach: A hexadecimal number is a positional numeral system with a radix, or base, of 16 and uses sixteen distinct symbols.
A binary number is a number expressed in the base-2 binary numeral system, which uses only two symbols: which are 0 (zero) and 1 (one).
To convert HexaDecimal number to Binary, the binary equivalent of each digit of the HexaDecimal number is evaluated and combined at the end to get the equivalent binary number.
Below is the implementation of the above approach:
Equivalent Binary value is : 0001101011000101
Alternate Approach :
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Convert a binary number to hexadecimal number
- Program to Convert Octal to Hexadecimal
- Program to Convert Octal Number to Binary Number
- Program for decimal to hexadecimal conversion
- Program to convert a given number to words
- Program to convert Number in characters
- Program to convert a given number to words | Set 2
- Program to Convert BCD number into Decimal number
- Program to convert a BCD to Hexa-Decimal Number
- Program to convert Hexa-Decimal Number to its equivalent BCD
- Count Hexadecimal Number
- Check if a HexaDecimal number is Even or Odd
- Reverse bytes of a Hexadecimal Number
- Largest Even and Odd N-digit numbers in Hexadecimal Number System
- C program to count zeros and ones in binary representation of a number
- Program to convert given number of days in terms of Years, Weeks and Days
- Convert Binary fraction to Decimal
- Convert the given BCD to its equivalent Binary form
- Program to Convert Radian to Degree
- Program to convert Degree to Radian
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.