Update helloworld.c

added a factorial function