Hi guys
I have a vector with 9 elements
vec[20]= 80.59 , 132.40, 81.85, 79.83, 119.96, 111.89, 110.99, 101.21, 118.53
Im trying to put them in an anscending order
thats what the console shows me:
80.59 79.83 81.85 101.21 110.99 111.89 118.53 119.96 132.40
for(k=1;k<=i-1;k++)
{
for(j=k+1;j
{
if(vec[k]>vec[j])
{
aux=vec[k];
vec[k]=vec[j];
vec[j]=aux;
}
}
}
Up is the formule i used but it is not working.
What Should I do? I am working in C Programming.