QBASIC PROGRAM TO CHECK WHETHER A NUMBER IS DIVISIBLE BY BOTH 4 AND 6 OR NOT
CLS
INPUT “ENTER A NUMBER ” ; P
IF P MOD 4 =0 AND P MOD 6=0 THEN
PRINT “DIVISIBLE BY BOTH NUMBERS”
ELSE
PRINT “NOT DIVISIBLE BY BOTH NUMBERS”
ENDIF
END
USING SUB
DECLARE SUB FOURSIX(P)
CLS
INPUT “ENTER A NUMBER ” ; P
CALL FOURSIX(P)
END
SUB FOURSIX(P)
IF P MOD 4 =0 AND P MOD 6=0 THEN
PRINT “DIVISIBLE BY BOTH NUMBERS”
ELSE
PRINT “NOT DIVISIBLE BY BOTH NUMBERS”
ENDIF
END SUB
0 Comments