misc C code from labs, assignments, and practice questions