An university assignment done with C