What is simulation recursion in C?

1 answer

Answer

1101630

2026-07-08 14:10

+ Follow

The factorial f(n) = n * (n-1) * (n-2) * .. 1. For example factorial 5 (written as 5!) = 5 x 4 x 3 x 2 x 1 = 120. The function below returns the factorial of the parameter n. int factorial( int n) {

if (n==1)

return 1

else

return n* factorial( n-1) ;

}

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.