A course assignment done with C