home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
OS2
/
LB04.ZIP
/
FACTORIL.BAS
< prev
next >
Wrap
BASIC Source File
|
1993-11-22
|
436b
|
26 lines
'this program computes a factorial for a keyboard entered
'number and displays the result
input "Please enter a number>"; entry
result = 1
[recurringLoop]
counter = counter + 1
if counter > entry then [skip]
result = result * counter
gosub [recurringLoop]
[skip]
entry = entry - 1
if entry = 1 then [end]
return
[end]
print "The factorial is: "; result