FactorialByValue.m is been added
This commit is contained in:
parent
f49e03b71d
commit
dad10a78c2
|
@ -0,0 +1,12 @@
|
|||
write "Enter n: "
|
||||
read n,!
|
||||
set result=$$factorial(n)
|
||||
write n,"! = ",result,!
|
||||
halt
|
||||
|
||||
factorial(n)
|
||||
if n=1 quit 1
|
||||
set k=1
|
||||
for i=1:1:n do
|
||||
. set k=k*i
|
||||
quit k
|
Loading…
Reference in New Issue