Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program that prompts the user to input three integers. You may assume th

ID: 3624103 • Letter: W

Question

Write a program that prompts the user to input three integers. You may assume that none of the integers are equal. The output of the program should print the numbers in order from largest to smallest. Use value-returning functions to determine which number is largest, smallest and in the middle. Remember that value-returning functions should not have cin or cout statements. Don’t forget to put the <your name> statement in your program.

Run the program with the following six sets of data:
(You may paste all of the sets of output into the same text file. Make sure you include your prompts and input values.)
86 76 66
43 73 93
52 92 72
61 71 51
75 65 95
100 50 80

Explanation / Answer

please rate - thanks

#include <iostream>
using namespace std;
int large(int,int,int);
int middle(int,int,int);
int small(int,int,int);
int main()
{int val1,val2,val3,largest,mid,smallest;
cout<<"Enter first number: ";
cin>>val1;
cout<<"Enter second number: ";
cin>>val2;
cout<<"Enter third number: ";
cin>>val3;
largest=large(val1,val2,val3);
mid=middle(val1,val2,val3);
smallest=small(val1,val2,val3);
cout<<"the numbers increasing are: "<<smallest<<", "<<mid<<", "<<largest<<endl;
system("pause");
return 0;
}
int large(int a,int b,int c)
{int large;
large=a;
if(b>large)
    large=b;
if(c>large)
    large=c;
return large;
}
int small(int a,int b,int c)
{int smal;
smal=a;
if(b<smal)
    smal=b;
if(c<smal)
    smal=c;
return smal;
}
int middle(int a,int b,int c)
{int mid;
mid=a;
if(a<b&&b<c||c<b&&b<a)
       mid=b;
else if(a<c&&c<b||b<c&&c<a)
       mid=c;
return mid;
}