FactorialByValue.m is been shortened

This commit is contained in:
programarivm 2019-09-26 10:43:20 +01:00
parent 623565d6fa
commit cacf6b0e44
1 changed files with 9 additions and 9 deletions

View File

@ -1,11 +1,11 @@
read "Enter n: ",n,!
set result=$$factorial(n)
write n,"! = ",result,!
halt
r "Enter n: ",n,!
s result=$$factorial(n)
w n,"! = ",result,!
h
factorial(n)
if n=1 quit 1
set k=1
for i=1:1:n do
. set k=k*i
quit k
i n=1 q 1
s k=1
f i=1:1:n d
. s k=k*i
q k