Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

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 »
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
Co
ect 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
XXXXXXXXXX
Show Details
Test CaseIncomplete
All positive not in order case 1
Input
839
732
803
Output
Results
XXXXXXXXXX
Show Details
Test CaseIncomplete
All negative not in order case 1
Input
-489
-503
-89
Output
Results
XXXXXXXXXX
Show Details
Test CaseIncomplete
Positive, negative and zero case 1
Input
8943
-3435
0
Output
Results
XXXXXXXXXX
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
Co
ect 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
XXXXXXXXXX
Show Details
Test CaseIncomplete
All positive not in order case 1
Input
839
732
803
Output
Results
XXXXXXXXXX
Show Details
Test CaseIncomplete
All negative not in order case 1
Input
-489
-503
-89
Output
Results
XXXXXXXXXX
Show Details
Test CaseIncomplete
Positive, negative and zero case 1
Input
8943
-3435
0
Output
Results
XXXXXXXXXX
From the book:
Eight Edition
C++ PROGRAMMING
Program Design Including Data Structures
C++ PROGRAMMING
Answered Same Day Oct 09, 2021

Solution

Kshitij answered on Oct 09 2021
151 Votes
# include
its/stdc++.h
# include# includeusing 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