Question: I need a C++ code that asks the user to enter two decimal numbers to be compared. exmaple: Enter the FIRST number to compare: Enter
I need a C++ code that asks the user to enter two decimal numbers to be compared. exmaple:
Enter the FIRST number to compare:
Enter the SECOND number to compare:
The program then proceeds to compare the numbers, and decide on which of the following three messages to display on screen:
The first number is EQUAL to the second number.
The first number is GREATER than the second number.
The first number is LESS than the second number.
Finally, the program should ask the user:
Do you want to compare numbers again? (Y/N)
The user then presses a key. If the user enters Y, the program should start over asking for new numbers and making another comparison. If the user enters N, the program should exit. On the other hand, if the user enters any other key, the program should insist in asking the above question until the user presses either Y or N. Uppercase and lowercase versions of the same letter should be treated the same.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
