01-factorial-by-reference.mps is been added

This commit is contained in:
programarivm 2019-09-24 20:54:45 +01:00
parent 15f7af48c2
commit 1befed4ba1
1 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,16 @@
#!/usr/bin/mumps
write "Enter n: "
read 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