9.5 Calculate a factorial

Factorial of the integer 5 is defined by:

5! = 5 × 4× 3 × 2× 1 = 120
For n positive integer, we can note that: n! = n × (n - 1)!.
This relation explains the recursive nature of the program:
to fac :n  
if :n=0[output 1][output :n*fac :n-1]  
ent  
 
pr fac 5  
120  
pr fac 6  
720