Problem 2627. Convert to Binary Coded Decimal
Convert from decimal representation to Binary Code Decimal (or BCD) representation.
Examples
So 5 becomes '0101'
12 is '00010010' (because 1 is '0001' and 2 is '0010')
156 is '000101010110'
Solution Stats
Problem Comments
Solution Comments
Show commentsGroup

Number Manipulation II
- 15 Problems
- 47 Finishers
- Mysterious digits operation (easy)
- Big numbers, repeated least significant digits
- Bit calculation
- Power Times (of the day)
- Equation Times (of the day)
- Consecutive Equation Times (of the day)
- Find out the Gray Code for a Given Binary Number
- Convert to Binary Coded Decimal
- Binary Neighbourhood
- Digital Neighbourhood
- There are 10 types of people in the world
- Big numbers, least significant digits
- Big numbers, repeated least significant digits
- De-primed
- Evened up (or not)
- With apologies to William Blake
Problem Recent Solvers137
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!