Question: C languange. Write a program that reads in a date and converts it to BCD. Your program should print out the original date, its BCD
C languange.
Write a program that reads in a date and converts it to BCD. Your program should print out the original date, its BCD equivalent (in hexadecimal format), and the raw date value (the BCD as an int). The program should continue to execute until EOF is detected. For dates, assume that you will always enter them like: 12-4-2017 That is, a day, a month, and a 4-digit year. This implies reading the date into 3 variables, then putting it into a single variable in BCD format. Don't worry about validating the day value relative to the month it's in, or ensuring that you have the correct number of digits for each value. Your output should look something like: 12-4-2017 12042017 302260247 Write a program that reads in a date and converts it to BCD. Your program should print out the original date, its BCD equivalent (in hexadecimal format), and the raw date value (the BCD as an int). The program should continue to execute until EOF is detected. For dates, assume that you will always enter them like: 12-4-2017 That is, a day, a month, and a 4-digit year. This implies reading the date into 3 variables, then putting it into a single variable in BCD format. Don't worry about validating the day value relative to the month it's in, or ensuring that you have the correct number of digits for each value. Your output should look something like: 12-4-2017 12042017 302260247
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
