Witam. Program wypisuje lecz nie posortowane liczby. Chciałabym aby funkcja sortująca była w main i na razie bez uzycia wskaźników
#include <stdio.h>
int main (void)
{
int tab[10];
printf("Podaj wartości tablicy od 1 do 10\n");
for(int i =0;i<10;i++)
{
printf("Podaj wartosc %d = ",i);
scanf("%d",&tab[i]);
printf("Tab od [%d]=%d\n",i,tab[i]);
}
for(int i=0;i<10;i++)
{
int temp;
if(tab[i]>tab[i+1])
{
tab[i]=temp;
tab[i+1]=temp;
tab[i]=tab[i+1];
printf("posortowane liczby: ");
for(i=0;i<10;i++)
{
printf("%d, ",tab[i]);
}
}
}
return 0;
}