Saturday, October 12, 2019

QBASIC to diplay Odd or Even

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

QBASIC 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

QBASIC to find Volume of Cylinder

CLS
INPUT "Enter the radisu"; R

INPUT "Enter the height"; H
V =  22/7*R^2*H
PRINT "Volume of cylinder="; V
END 

QBASIC to find Volume of Cube

CLS
INPUT "Enter the length"; L

V = L^3
PRINT "Volume of cube="; V
END

QBASIC to find Volume of box

CLS
INPUT "Enter the length"; L
INPUT "Enter the breadth": B
INPUT "Enter the height"; H
V = L*B*H
PRINT "Volume of box="; V
END  

QBASIC to find Area of Square

CLS
INPUT "Ente the length"; L

A = L^2
PRINT "Area of square="; A
END

QBASIC to find Area of four walls


CLS
INPUT "Enter the length"; L

INPUT "Enter the breadth"; B
INPUT "Enter the height"; H
A = 2*H*(L+B)
PRINT "Area of four walls="; A

END