QBASIC PROGRAM TO FIND WHETHER A NUMBER IS COMPLETELY DIVISIBLE BY 3 AND 7

QBASIC PROGRAM TO FIND WHETHER A NUMBER IS COMPLETELY DIVISIBLE BY 3 AND 7



 CLS
 INPUT “ENTER ANY NUMBER”; N
 IF N MOD 3 = 0 AND N MOD 7 = 0 THEN
 PRINT N;" IS COMPLETELY DIVISIBLE BY 3 AND 7"
 ELSE
 PRINT N;" IS NOT COMPLETELY DIVISIBLE BY 3 AND 7"
 END IF
 END

USING SUB


DECLARE SUB DIVIDE(N)
 CLS
 INPUT “ENTER ANY NUMBER”; N
 CALL DIVIDE(N)
 END
 
 SUB DIVIDE(N)
 IF N MOD 3 = 0 AND N MOD 7 = 0 THEN
 PRINT N;" IS COMPLETELY DIVISIBLE BY 3 AND 7"
 ELSE
 PRINT N;" IS NOT COMPLETELY DIVISIBLE BY 3 AND 7"
 END IF
 END SUB

Post a Comment

0 Comments