Update factorial.cpp

Added factorial_i (returns int), and changed the pointer function to factorial_p. Also added while loop in main.