Answers for "c how to ordinate array"

C
1

c how to ordinate array

int i, j, vett[N],temp, posmin;

for(i = 0; i < N - 1; i ++)
	{
		posmin = i;
		
		for(j = i + 1; j < N; j ++)
		{
			posmin = j;
			
			if(vett[i] > vett[posmin])
		    {
				temp = vett[posmin];
				vett[posmin] = vett[i];
				vett[i] = temp;
			}
		}
	}
Posted by: Guest on February-11-2021

Code answers related to "C"

Browse Popular Code Answers by Language