Ch5: implemented factorial.c