CLS

INPUT "ENTER ANY NUMBER"; N

F = 1

FOR I = 1 TO N

C = 0

FOR J = 1 TO I

IF I MOD J = 0 THEN C = C + 1

NEXT J

IF C = 2 THEN F = F * I

NEXT I

PRINT "PRIME FACTORIAL ="; F

END

USING SUB PROCEDURE

DECLARE SUB FACT (N)

CLS

INPUT "ENTER ANY NUMBER"; N

CALL FACT (N)

END

SUB FACT (N)

F = 1

FOR I = 1 TO N

C = 0

FOR J = 1 TO I

IF I MOD J = 0 THEN C = C + 1

NEXT J

IF C = 2 THEN F = F * I

NEXT I

PRINT "PRIME FACTORIAL ="; F

END SUB

USING FUNCTION PROCEDURE

DECLARE FUNCTION FACT (N)

CLS

INPUT "ENTER ANY NUMBER"; N

PRINT "PRIME FACTORIAL ="; FACT (N)

END

FUNCTION FACT (N)

F = 1

FOR I = 1 TO N

C = 0

FOR J = 1 TO I

IF I MOD J = 0 THEN C = C + 1

NEXT J

IF C = 2 THEN F = F * I

NEXT I

FACT = F

END FUNCTION

## No Comments