Assignment 1: C Programming solution