Posts

Showing posts with the label computer

QBASIC PROGRAMMING SLC/SEE

To input any number and display whether input number is positive negative or neutral CLS INPUT " enter any number"; n r = SGN(n) IF r = 1 THEN     PRINT "positive" ELSEIF r = -1 THEN     PRINT "egative" ELSE     PRINT "neutral" END IF END To check whether input number is perfectly divisible by 3 and 5 CLS INPUT "enter any number"; n r = n MOD 3 r1 = n MOD 5 IF r = 0 AND r1 = 0 THEN     PRINT "perfectly divisible" ELSE     PRINT "not perfectly divisible" END IF END To display the middle number among given three numbers CLS INPUT "enter any number"; a, b, c IF a > b AND a < c OR a < b AND a > c THEN m = a IF b > a AND b < c OR b < a AND b > c THEN m = b IF c > a AND c < b OR c < a AND c > b THEN m = c PRINT m END To display first 10 number with its square and cube CLS PRINT "number", "s...