c how to ordinate array

Solutions on MaxInterview for c how to ordinate array by the best coders in the world

showing results for - "c how to ordinate array"
Jovan
05 Nov 2019
1int i, j, vett[N],temp, posmin;
2
3for(i = 0; i < N - 1; i ++)
4	{
5		posmin = i;
6		
7		for(j = i + 1; j < N; j ++)
8		{
9			posmin = j;
10			
11			if(vett[i] > vett[posmin])
12		    {
13				temp = vett[posmin];
14				vett[posmin] = vett[i];
15				vett[i] = temp;
16			}
17		}
18	}