Similar questions asked many times but I'm working on this endlessly without success so need your help
void sort(int values[], int n)
{
// TODO: implement an O(n^2) sorting algorithm
int i,j,k,tmp;
for(j = 0; j < n-1; j++)
{
for(i = 0; i < n-j-1; i++)
{
if(values[i] > values[i+1])
{
tmp=values[i];
values[i]=values[i+1];
values[i]=tmp;
}
}
}
for (k = 0; k < n; k++)
{
printf("\n");
printf("no%d: %d",k,values[k]);
}
return;
}
last printf
indicates my list is not sorted. I am compiling find.c with generate.c