Write a C++ program for the conversion of a decimal number to a binary, octal and hexadecimal equivalents within a given range of the upper and lower limits. Your program needs to follow the following steps to give the desired output. (1.a). Your program should ask to choose the upper limit from 256, 128, 32, 16, 8, 4, 2 only. If a user enters a number other than these numbers, the program should display a message of wrong entry and should ask for retry, otherwise continue to step (b). (1.b). Your program should ask to enter the lower limit. The lower limit should be less than the upper limit (of step 1.a) and greater than 0. If a user enters a number greater than the upper limit or less than 0 (e.g., a negative value), then the program should display a message of wrong entry and should ask for retry, otherwise continue to display the output. (1.c). If a user enters the upper and lower limits correctly, then the program should print a table of the binary, octal and hexadecimal equivalents of the given decimal numbers in the range of upper and lower limits as given in screenshots. Use of while loop, if else, for loop, nested loops is allowed. Functions, arrays and goto statements are NOT allowed.
Write a C++
equivalents within a given range of the upper and lower limits. Your program needs to follow the
following steps to give the desired output.
(1.a). Your program should ask to choose the upper limit from 256, 128, 32, 16, 8, 4, 2 only. If a
user enters a number other than these numbers, the program should display a message of wrong
entry and should ask for retry, otherwise continue to step (b).
(1.b). Your program should ask to enter the lower limit. The lower limit should be less than the
upper limit (of step 1.a) and greater than 0. If a user enters a number greater than the upper limit
or less than 0 (e.g., a negative value), then the program should display a message of wrong entry
and should ask for retry, otherwise continue to display the output.
(1.c). If a user enters the upper and lower limits correctly, then the program should print a table of
the binary, octal and hexadecimal equivalents of the given decimal numbers in the range of upper
and lower limits as given in screenshots.
Use of while loop, if else, for loop, nested loops is allowed. Functions, arrays and goto statements are NOT allowed.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images