Wednesday, October 30, 2019

QBASIC PROGRAMMING #2(To find area)


To Find Area of Four Walls

CLS
INPUT "Enter length"; l
INPUT "Enter breadth"; b
INPUT "Enter height"; h
A = 2 * h * (l + b)
PRINT "Area of four walls="; A
END


To Find Area of Square

CLS
INPUT "Enter length"; l
A = l ^ 2
PRINT "Area of square="; A
END



To Find Area of Triangle

CLS
INPUT "Enter base"; b
INPUT "Enter height"; h
A = 1 / 2 * b * h
PRINT "Area of triangle="; A
END



To Find Area of Circle

CLS
INPUT "Enter radius"; r
A = 22 / 7 * r ^ 2
PRINT "Area of circle="; A
END

No comments:

Post a Comment