#include #include #include "hw5data.h" void sortem(char*[], int); main() { int i; printf("\nMonths\n-----------\n"); for (i=0; i<12; i++) { printf("%d: %s\n", i, months[i]); } // your sort function goes here sortem(months, 12); printf("\nMonths Sorted\n-----------\n"); for (i=0; i<12; i++) { printf("%d: %s\n", i, months[i]); } printf("\nDays\n-----------\n"); for (i=0; i<7; i++) { printf("%d: %s\n", i, days[i]); } // your sort function goes here sortem(days, 7); printf("\nDays Sorted\n-----------\n"); for (i=0; i<7; i++) { printf("%d: %s\n", i, days[i]); } } void sortem(char *inar[], int numvals) { int i, j; char *temp; int templen; for (i=1; i 0 && (strlen(inar[j-1]) > strlen(inar[j]))) { temp = inar[j]; inar[j] = inar[j-1]; inar[j-1] = temp; j--; } } }