Wednesday, October 16, 2019

42. Qbasic program to test whether the given number is completely divisible by 13 or not

42.      Using SUB…END SUB, write a program to test whether the given number is completely divisible by 13 or not.

DECLARE SUB CHECK (N)
CLS
INPUT “ENTER ANY NUMBER”; N
CALL CHECK (N)
END
SUB CHECK (N)
IF N MOD 13 = 0 THEN
PRINT “The given number is divisible by 13”
ELSE
PRINT “The given number is not divisible by 13”
END IF
END SUB

1 comment: