Sorting by selection in C

Sorting by  selection  is a sorting by comparison. The  principle  sorting of  selection  is as follows:
  • Find the smallest element and swap it with the first element t[1].
  • Search for it  Second  small element and swap it with the second element t[2].
  • Doing it  Same  thing with the rest of the elements until the array is  sorted.
C/C++ - sort by selection

#include< stdio.h>
#include< stdlib.h>


void tri_selection(int t[], int n)

int min,temp;
for(int i = 0 ; i < n-1 ; i++)
{
min = i;
for(int j = i+1 ; j < n ; j++)
if(t[j] < t[min])
min = j;
if(min!=i)
{
//swap t[i] and t[min]
temp = t[i];
t[i]=t[min];
t[min]=temp;
}
}
}

main()
{
int T[10]={5,2,126,9,51,7,1,6,12,24};
tri_selection(T,10);
for (int i=0 ; i< 10 ; i++)
printf("%d ",T[i]);
system("pause");
}