mumps-demo/04-user-defined-functions/FactorialByReference.m

14 lines
164 B
Mathematica
Raw Normal View History

2019-09-26 05:10:09 -04:00
read "Enter n: ",n,!
write n,"! = "
do factorial(.n)
write n,!
halt
factorial(n)
if n=1 quit
set k=1
for i=1:1:n do
. set k=k*i
set n=k
quit