Solved calculate factorial