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) ;
}
Copyright © 2026 eLLeNow.com All Rights Reserved.