This program lets you enter up to MAX values (20 in this case). It sorts the
values and prints them in order. Then it lets you enter a value to search for in
the array. A printed message states the search's status.

Familiar code is used to obtain the values for the array on lines 18 and 19.
Line 26 contains the call to qsort() to sort the array. The first argument is a
pointer to the array's first element. This is followed by MAX, the number of
elements in the array. The size of the first element is then provided so that
qsort() knows the width of each item. The call is finished with the argument for
the sort function, intcmp.

The function intcmp() is defined on lines 52 through 55. It returns the
difference of the two values passed to it. This might seem too simple at first,
but remember what values the comparison function is supposed to return. If the
elements are equal, 0 should be returned. If element one is greater than element
two, a positive number should be returned. If element one is less than element
two, a negative number should be returned. This is exactly what intcmp() does.

The searching is done with bsearch(). Notice that its arguments are virtually
the same as those of qsort(). The difference is that the first argument of
bsearch() is the key to be searched for. bsearch() returns a pointer to the
location of the found key or NULL if the key isn't found. On line 43, ptr is
assigned the returned value of bsearch(). ptr is used in the if loop on lines 45
through 48 to print the status of the search.