Cognizant interview question

Write a c code for factorial function