Cognizant interview question

Code for Fibonacci series and factorial