NxStage interview question

Write a C++ function that solves a factorial