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 a Number"; N
IF N>0 THEN
PRINT" The number is Positive"
ELSE
PRINT" The number is Negative"
END IF
END
QBASIC Program To Check Whether A Number Is Positive Or Negative Using SUB Procedure
DECLARE SUB CHECK(N)
CLS
INPUT" Enter a Number"; N
CALL CHECK(N)
END
SUB CHECK(N)
IF N>0 THEN
PRINT" The number is Positive"
ELSE
PRINT" The number is Negative"
END IF
END SUB
QBASIC Program To Check Whether A Number Is Positive Or Negative Using SUB Procedure
DECLARE FUNCTION CHECK$(N)
CLS
INPUT" Enter a Number"; N
PRINT CHECK$(N)
END
FUNCTION CHECK$(N)
IF N>0 THEN
CHECK$=" The number is Positive"
ELSE
CHECK$=" The number is Negative"
END IF
END FUNCTION
Comments
Post a Comment