/* * Functions for manipulating a table. * tableInsert - insert an integer into correct place in table * tablePrint - print table in sorted order */ #include void tableInsert(int a[], int num, int val) { int pos; for (pos = num; pos > 0 && val < a[pos-1]; pos--) a[pos] = a[pos-1]; a[pos] = val; } void tablePrint(int a[], int num) { int i; for (i = 0; i < num; i++) printf("%i\n", a[i]); }