7. Write a C'C++ program that reads in a sequence of positive integers and prints out their BCD presentations, and the corresponding numbers in binary and hexadecimal. Examples s ./bed2binary 64 9891 113 2020 Decimal BCD Binary Hexadecimal 64 e000000001100100 1000000 40 9891 100110001001e001 10011010100011 26a3 113 100100010001e011 1110001 71 2020 e01000000010e000 11111100100 7e4

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter17: Linked Lists
Section: Chapter Questions
Problem 22SA
icon
Related questions
icon
Concept explainers
Question
7. Write a C'C++ program that reads in a sequence of positive integers and prints out their BCD presentations, and the corresponding numbers in binary and hexadecimal.
Examples
$ ./bcd2binary 64 9891 113 2020
Decimal
BCD
Binary
Hexadecimal
64
e00ee00001100100
1000000
40
9891
1001100010010001
10011010100011
26a3
113
1001000100010011
1110001
71
2020
e01000000010e000
11111100100
7e4
Transcribed Image Text:7. Write a C'C++ program that reads in a sequence of positive integers and prints out their BCD presentations, and the corresponding numbers in binary and hexadecimal. Examples $ ./bcd2binary 64 9891 113 2020 Decimal BCD Binary Hexadecimal 64 e00ee00001100100 1000000 40 9891 1001100010010001 10011010100011 26a3 113 1001000100010011 1110001 71 2020 e01000000010e000 11111100100 7e4
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Operators
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning