
Modular Programming in Q BASIC Examples 2
Display the factorial of input number SUB Procedure DECLARE SUB FACT (N) CLS INPUT “Enter any number”; N CALL FACT(N) END SUB FACT (N) F = 1 FOR J = 1 TO N F = F * J NEXT J …
Read More........Display the factorial of input number SUB Procedure DECLARE SUB FACT (N) CLS INPUT “Enter any number”; N CALL FACT(N) END SUB FACT (N) F = 1 FOR J = 1 TO N F = F * J NEXT J …
Read More........1. Test whether the given number is positive or negative. SUB PROCEDURE DECLARE SUBTEST(N) CLS INPUT "Enter a number"; N CALL TEST(N) END SUB TEST(N) IF N>0 THEN PRINT N; "is positive number" ELSE PRINT N; "is negative number" END …
Read More........Modular programming. Modular programming is the process of subdividing a program into separate sub-programs. Each modular program has one main module and may have other sub modules and sub module of a program is also called as procedure. Similar …
Read More........