C Code for COS 217 Assignments