NxStage Interview Question

Write a C++ function that solves a factorial