To Display Odd or Even Number
CLS
INPUT "Enter any number"; N
IF N MOD 2 = 0 THEN
PRINT "The number is even"
ELSE
PRINT "The number is odd"
END IF
END
INPUT "Enter any number"; N
IF N MOD 2 = 0 THEN
PRINT "The number is even"
ELSE
PRINT "The number is odd"
END IF
END
QBasic Programming:
To Display Positive, Negative or Zero
CLS
INPUT "Enter any number"; N
IF N > 0 THEN
PRINT "The number is positive"
ELSEIF N < 0 THEN
PRINT "The number is negative"
ELSE
PRINT "The number is zero"
END IF
END
No comments:
Post a Comment