QBASIC Program To Check Whether A Number Is Odd Or Even
QBASIC Program To Check Whether A Number Is Odd Or Even
CLS
INPUT "Enter a Number "; N
IF N MOD 2 = 0 THEN
PRINT "Even Number"
ELSE
PRINT " Odd Number "
END IF
END
QBASIC Program To Check Whether A Number Is Odd Or Even Using SUB Procedure
DECLARE SUB CHECK(N)
CLS
INPUT "Enter a Number "; N
CALL CHECK(N)
END
SUB CHECK(N)
IF N MOD 2 = 0 THEN
PRINT "Even Number"
ELSE
PRINT " Odd Number "
END IF
END SUB
QBASIC Program To Check Whether A Number Is Odd Or Even Using FUNCTION Procedure
DECLARE FUNCTION CHECK$(N)
CLS
INPUT" Enter a Number"; N
PRINT CHECK$(N)
END
FUNCTION CHECK$(N)
IF N MOD 2 = 0 THEN
CHECK$="Even Number"
ELSE
CHECK$="Odd Number"
END IF
END FUNCTION
Comments
Post a Comment