Code for "A Factorial Problem"

can anyone provide me the running code solution of “A factorial problem”