#include #include "genlib.h" #include "simpio.h" #define size 7 void sortArray (int numbers[]); int indexMax (int numbers[], int low, int high); void swap (int numbers[], int loc1, int loc2); void getArray (int numbers[]); void displayArray (int numbers[]); main() { int numbers[size]; getArray(numbers); sortArray(numbers ); displayArray (numbers); } void getArray (int numbers[]) { int i; for (i=0; i0;i--) { maxInd = indexMax (numbers, 0, i); swap (numbers, i, maxInd); } } int indexMax (int numbers[], int low, int high) { int i, maxInd; maxInd=high; for (i=high;i>=low;i--) { if (numbers[i] > numbers[maxInd]) maxInd =i; } printf("Largest value between %d and %d is %d.", low, high, maxInd); return (maxInd); } void swap (int numbers[], int loc1, int loc2) { int temp; temp=numbers[loc1]; numbers[loc1]=numbers[loc2]; numbers[loc2] = temp; }