QBASIC PROGRAM TO FIND FACTORIAL OF A NUMBER



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

Post a Comment

0 Comments