If numb is 5, then the task is to compute 5!. At the start fact is 1. After the first loop iteration fact is 1*5, and after the next iteration it is 1*5*4, ... until fact has the value of 1*5*4*3*2*1. This is the same as 1*5!. Multiplying by one doesn't change the value so the result is 5! which is what you want. If the initial value of fact was something else then the result would not be 5!.