Wednesday, October 16, 2019

48. Qbasic program to input any number and check whether the given no. is positive or negative

48.      Write a program to input any number and check whether the given no. is positive or negative using sub procedure.

DECLARE SUB CHECK (N)
CLS
INPUT “ENTER ANY NUMBER”; N
CALL CHECK (N)
END
SUB CHECK (N)
IF N > 0 THEN
PRINT “ POSITIVE NUMBER”
ELSEIF N < 0 THEN
PRINT “ NEGATIVE NUMBER”
END IF
END SUB

No comments:

Post a Comment