Inside the loop, on each iteration, we are multiplying the current value of i with factorial. Once the loop will end, factorial will hold the factorial of the given number . We can also run this loop from i = 2 i.e. we can multiply all numbers from i = 2 to i = number.
For More Information Please Refer: