WAP to find whether a number is divisible by 5 or not

Qbasic program to find whether a number is divisible by 5 or not



 CLS
 INPUT “ENTER ANY NUMBER”; N
 IF N MOD 5 = 0 THEN
 PRINT N; IS DIVISIBLE BY 5”
 ELSE
 PRINT N; IS NOT DIVISIBLE BY 5”
 END IF
 END

USING SUB


DECLARE SUB DIVISIBLE(N)
 CLS
 INPUT “ENTER ANY NUMBER”; N
 CALL DIVISIBLE(N)
 END
 
 SUB DIVISIBLE(N)
 IF N MOD 5 = 0 THEN
 PRINT N; IS DIVISIBLE BY 5”
 ELSE
 PRINT N; IS NOT DIVISIBLE BY 5”
 END IF
 END SUB

Post a Comment

0 Comments