Factorial using recursion in C
问题 We all know the program for this int fact(int n) { if(n==0) return(1); return(n*fact(n-1)); } But what is not clear to me is how the inner thing is happening? How is it calculating 5*4*3*2*1 (if n is 5) Please give a clear explanation on this. Thanks..... 回答1: Mathematically, the recursive definition of factorial can be expressed recursively like so (from Wikipedia): Consider how this works for n = 3 , using == to mean equivalence: 3! == 2! * 3 == (1! * 2) * 3 == ((1) * 2) * 3 This can be