Question: undefined Write a C++ program that converts a decimal number to binary, or a binary number to decimal based on the user selection. Your program
undefined
Write a C++ program that converts a decimal number to binary, or a binary number to decimal based on the user selection. Your program should prompt the user for two options. The first option will prompt the user for an integer as a decimal number, convert to binary, and print the result. The second option will prompt the user for an integer as a binary number, convert to decimal, and print the result (see the sample output below) Sample output "Welcome" (1) Converts decimal to binary (2) Converts binary to decimal Choose an option (1 or 2):1 Enter a decimal number: 6 6 converted to binary is: 110 Would you like to convert another number (y)? y "Welcome" (1) Converts decimal to binary (2) Converts binary to decimal Choose an option (1 or 2):2 Enter a binary number 1010 1010 converted to decimal is: 10 Would you like to convert another number (y)?n "Goodbye
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
