
Patrick B. answered 04/05/21
Math and computer tutor/teacher
using namespace std;
#include <iostream>
void intSwap( int * x, int * y)
{
int iTemp;
iTemp = *y;
*y = *x;
*x = iTemp;
}
Go()
{
int num1;
int num2;
int num3;
cout << "Please input the 1st integer :>";
cin >> num1;
cout << "Please input the 2nd integer :>";
cin >> num2;
cout << "Please input the 3rd integer :>";
cin >> num3;
if (num1>num2) { intSwap(&num1,&num2); }
if (num2>num3) { intSwap(&num2,&num3); } //num3 contains the largest
if (num1>num2) { intSwap(&num1,&num2); } //sorting complete
cout << num1 << " " << num2 << " " << num3 << endl;
}
int main()
{
Go();
}