void sortAr( int studentID[], float progAvg[], float testAvg[],float overallAvg[], int studentcount) { int top = 0, last = 19, ptr, ssf; double temp; if ( top < last) { ptr = top; ssf = top; if ( ptr <= last) { if ( studentID[ptr] < studentID[ssf]) { ssf = ptr; } ptr++; } temp = studentID[top]; studentID[top] = studentID[ssf]; studentID[ssf] = temp; temp = progAvg[top]; progAvg[top] = progAvg[ssf]; progAvg[ssf] = temp; temp = testAvg[top]; testAvg[top] = testAvg[ssf]; testAvg[ssf] = temp; top++; } }