home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d9xx
/
d969
/
ace.lha
/
ACE
/
ACE-2.0.lha
/
PRGS.lha
/
Misc
/
fact.b
< prev
next >
Wrap
Text File
|
1994-01-10
|
301b
|
17 lines
'...factorial (calculated recursively).
'...note that 0! = 1 by definition.
defsng f,n,x
sub fact(n)
if n<2 then fact=1 else fact=n*fact(n-1)
end sub
repeat
print
repeat
input "Enter an integer (0 or higher, -1 to stop): ",x
until x>=-1
if x<>-1 then print "--->>";fact(x)
until x=-1