void descdend_order(struct employee descend[]){ int left, right; struct employee temp; for ( left = 0; left < 4; ++left ) //nested for loop for arrays once the right arrays loop is done the left will advance one untill all arrays are checked for ( right = left + 1; right < 5; ++right) if ( descend[rleft].net_salary < descend[right].net_salary ) //if the left data is larger then right data, then it will execute the following { temp = descend[left].net_salary; // temp is set to the left integer descend[left].net_salary = descend[right].net_salary; //the left data is swaped with the right data descend[right].net_salary = temp; //the right data is now set to the temp value } }