CLS
INPUT "Enter any number"; n
f = 1
FOR i = 1 TO n
f = f * i
NEXT i
PRINT "The factorial of input number is"; f
END
Using Sub Procedure.
DECLARE SUB factorial (n)
CLS
INPUT "Enter a number"; n
CALL factorial (n)
END
SUB factorial (n)
f = 1
FOR i = 1 TO n
f = f * i
NEXT i
PRINT "The factorial of input number is"; f
END SUB
INPUT "Enter any number"; n
f = 1
FOR i = 1 TO n
f = f * i
NEXT i
PRINT "The factorial of input number is"; f
END
Using Sub Procedure.
DECLARE SUB factorial (n)
CLS
INPUT "Enter a number"; n
CALL factorial (n)
END
SUB factorial (n)
f = 1
FOR i = 1 TO n
f = f * i
NEXT i
PRINT "The factorial of input number is"; f
END SUB