Cognizant interview question

Factorial program