CLS
INPUT ENTER ANY NUMBER; N
F = 1
FOR I = 1 TO N
F = F * I
NEXT I
PRINT FACTORIAL =; F
END
USING SUB
DECLARE SUB FACT(N)
CLS
INPUT ENTER ANY NUMBER; N
CALL FACT(N)
END
SUB FACT(N)
F = 1
FOR I = 1 TO N
F = F * I
NEXT I
PRINT FACTORIAL =; F
END SUB
0 Comments