Example Factorial
n! = n*(n-1)*...*2*1
4! = 4*3*2*1 = 24
Function to implement factorial:
fact(n) {
if n==1 then return 1
else return n*fact(n-1);
}
Previous slide
Next slide
Back to first slide
View graphic version