QBASIC PROGRAM TO CHECK POSITIVE,NEGATIVE OR ZERO

QBASIC PROGRAM TO CHECK POSITIVE,NEGATIVE OR ZERO



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

USING SUB


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

Post a Comment

0 Comments