Instructions Write a program that prompts the user to input three numbers. The program should then output the numbers in ascending order, separated by a single space. When the check run it looks for...

1 answer below »

Please see attached unit 4 details:


Instructions


Write a program that prompts the user to input three numbers.


The program should then output the numbers in ascending order, separated by a single space.




Instructions Write a program that prompts the user to input three numbers. The program should then output the numbers in ascending order, separated by a single space. When the check run it looks for the following: 0.00 out of 10.00 Correct output for all test cases 4 0 out of 4 checks passed. Review the results below for more details. Checks Test CaseIncomplete All positive in order case 1 Input 2 99 134 Output Results 2 99 134 Show Details Test CaseIncomplete All positive not in order case 1 Input 839 732 803 Output Results 732 803 839 Show Details Test CaseIncomplete All negative not in order case 1 Input -489 -503 -89 Output Results -503 -489 -89 Show Details Test CaseIncomplete Positive, negative and zero case 1 Input 8943 -3435 0 Output Results -3435 0 8943 From the book: Eight Edition C++ PROGRAMMING Program Design Including Data Structures C++ PROGRAMMING Instructions Write a program that prompts the user to input three numbers. The program should then output the numbers in ascending order, separated by a single space. When the check run it looks for the following: 0.00 out of 10.00 Correct output for all test cases 4 0 out of 4 checks passed. Review the results below for more details. Checks Test CaseIncomplete All positive in order case 1 Input 2 99 134 Output Results 2 99 134 Show Details Test CaseIncomplete All positive not in order case 1 Input 839 732 803 Output Results 732 803 839 Show Details Test CaseIncomplete All negative not in order case 1 Input -489 -503 -89 Output Results -503 -489 -89 Show Details Test CaseIncomplete Positive, negative and zero case 1 Input 8943 -3435 0 Output Results -3435 0 8943 From the book: Eight Edition C++ PROGRAMMING Program Design Including Data Structures C++ PROGRAMMING
Answered Same DayOct 09, 2021

Answer To: Instructions Write a program that prompts the user to input three numbers. The program should then...

Kshitij answered on Oct 09 2021
148 Votes
# include
# include
# include
using namespace std;
int main()
{
    int a[3];
    for (int i = 0; i < 3; i++) {
        cin >> a[i];
    }
    sort(a, a + 3);
    for (int i = 0; i < 3; i++) {
        cout << a[i] << " ";
    }
    cout << endl;
    return 0;
}
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here