QBASIC PROGRAM TO CHECK WHETHER A NUMBER IS POSITIVE OR NEGATIVE

QBASIC PROGRAM TO CHECK WHETHER A NUMBER IS POSITIVE OR NEGATIVE



 CLS
 INPUT “ENTER ANY NUMBER”; N
 IF N > 0 THEN
 PRINT N; IS POSITIVE NUMBER”
 ELSEIF N < 0 THEN
 PRINT N; IS NEGATIVE NUMBER”
 END IF
 END

USING SUB


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

Post a Comment

0 Comments