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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started