OSIsoft interview question

Code a function to find the factorial