RosettaCodeData/Task/Multifactorial/BBC-BASIC/multifactorial.basic

18 lines
264 B
Plaintext

REM >multifact
FOR i% = 1 TO 5
PRINT "Degree "; i%; ":";
FOR j% = 1 TO 10
PRINT " ";FNmultifact(j%, i%);
NEXT
PRINT
NEXT
END
:
DEF FNmultifact(n%, degree%)
LOCAL i%, mfact%
mfact% = 1
FOR i% = n% TO 1 STEP -degree%
mfact% = mfact% * i%
NEXT
= mfact%