In this factorial function why using -1


3/23/2020 1:47:26 PM


4 Answers

New Answer


If you want to calculate factorial say of 5 and you are starting from 5 then on each iteration the number is decresed by 1 and multiplied by the previous result 5x4x3x2x1 = 120


It is recursion, if you do not understand i suggest you first read about recursion.


Ohh thanks mate


But it's not for loop how it will execute till 120