There's no way that I would venture C code, but, the basic bubble sort algorithm is about the simplest sort imaginable. And, it is quite effecient when N (the number of elements to sort) is small - less than 50 or so.
Essentially, you have two loops, nested. Assume the loop counters are I and J. The outer loop (I) iterates from 1 to N-1. The inner loop (J) iterates from the I to N. You simply compare the elements I and J. If Element(I) < Element(J), then swap them. Then, continue through the rest of the iterations.
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert