Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a C++ program which will ask the user to input three integer numbers and then output which number is the largest, which is the
Write a C++ program which will ask the user to input three integer numbers and then output which number is the largest, which is the second largest and which is the smallest. We will not worry about any ties where two numbers are the same. Make sure your code works for any three input numbers, not just the test cases. Your code will be tested on other test cases not listed here. Please properly comment your code before submission. Sample Test cases: Test case 1: Enter the first number: 15 Enter the second number: 9 Enter the third number: 21 Test case 2: Enter the first number: 91 Enter the second number: 44 Enter the third number: 19 The largest number is 21 The next largest number is 15 The smallest number of 9 Test case 3: Enter the first number: 9 Enter the second number: 73 Enter the third number: 72 The largest number is 91 The next largest number is 44 The smallest number of 19 Test case 4: Enter the first number:-37 Enter the second number: -77 Enter the third number: 5 The largest number is 73 The next largest number is 72 The smallest number of 9 The largest number is 5 The next largest number is -37 The smallest number of -77 HINTS: Use cin and cout for input from the user and output to the screen. cin and cout can be imported using the iostream library. You can use Integer datatypes. Use if-else and/or if-else if-else conditions to compare numbers
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