I have tried to write my program, but it doesnt come out the way I want it, can some one please revise this source code fully to show how the corrections fit in. Heres the problem: Write a program that sorts three integers. The integers are entered from the console and stored in variables numi, num2, num3, respectively. The program sorts the numbers so that num 1 equal to or less than num 2 equal to or less than num 3.
Here is what Ive done so far. Thnx for help and support.
#include <iostream>
using namespace std;
int main()
if (n1 > n2)
{
int temp = n1;
n1 = n2;
n2 = temp;
}
if (n2 > n3)
{
int temp = n2;
n2 = n3;
n3 = temp;
}
if (n1 > n2)
{
int temp = n1;
n1 = n2;
n2 = temp;
}
{
cout<<"Enter an integer: ";
int int1;
cin>>int1;
cout<<"Enter another integer: ";
int int2;
cin>>int2;
cout<<"Enter a last integer: ";
int int3;
cin>>int3;
}