Dividing the number into chunks of 4, it becomes 1000 0010 1111.
Here, 1000 is equivalent to 8,
0010 is equivalent to 2 and
1111 is equivalent to F
Therefore, the number becomes 82F
Dividing the number into chunks of 4, it becomes 1010 1101.
Here, 1010 is equivalent to A and
1101 is equivalent to D.
Therefore, the number becomes AD.
- Divide the given BCD number into chunks of 4, and start computing its equivalent HexaDecimal form.
- Store this number formed in a vector.
- Repeat the process for all the digits of the given BCD number.
- Print the numbers stored in the vector in reverse order.
Below is the implementation of the above approach:
GeeksforGeeks has prepared a complete interview preparation course with premium videos, theory, practice problems, TA support and many more features. Please refer Placement 100 for details
- Program to Convert Hexadecimal Number to Binary
- Program to Convert Hexadecimal to Octal
- Program to Convert Octal to Hexadecimal
- Convert a binary number to hexadecimal number
- Program for Hexadecimal to Decimal
- Program to Convert Octal Number to Binary Number
- Program for decimal to hexadecimal conversion
- Program to convert Number in characters
- Program to convert a given number to words
- Program to convert a given number to words | Set 2
- Program to Convert BCD number into Decimal number
- Convert Hexadecimal value String to ASCII value String
- Program to convert Hexa-Decimal Number to its equivalent BCD
- Python program to convert decimal to binary number
- Count Hexadecimal Number
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.
Improved By : ipg2016107