Solutions to programming problems in C