my task is to sort the input numbers from lowest to highest but i just cant make it work... i've tried different ways and I know there's a problem in my code. hope you can help me out.
thanks!
#include <iostream.h>
struct trial
{
int age;
}
getcount[5];
void main()
{
int i=0;
int j = 1;
int x = 0;
int temp;
cout << "PLease enter 5 numbers:\n";
for(i=0;i<5;i++)
{
cout << j << "number: ";
cin >> getcount[i].age;
j = j+1;
}
for (i=0;i<5;i++)
{
temp = getcount[i].age;
cout << "\n" << temp;
/*if (x < temp)
{
x = temp;
cout << "\n" << x;
}*/
}
}