QBASIC PROGRAM TO FIND TOTAL SURFACE AREA AND VOLUME OF CYLINDER
CLS
INPUT “ENTER RADIUS ”; R
INPUT “ENTER HEIGHT”; H
A= 2 * 3.14 * R * (R + H)
V = 3.14 * R ^ 2 * H
PRINT “TOTAL SURFACE AREA OF CYLINDER “; A
PRINT “VOLUME OF CYLINDER ”; V
END
USING SUB
DECLARE SUB CYLINDER(R,H)
CLS
INPUT “ENTER RADIUS ”; R
INPUT “ENTER HEIGHT”; H
CALL CYLINDER(R,H)
END
SUB CYLINDER(R,H)
A= 2 * 3.14 * R * (R + H)
V = 3.14 * R ^ 2 * H
PRINT “TOTAL SURFACE AREA OF CYLINDER “; A
PRINT “VOLUME OF CYLINDER ”; V
END SUB
0 Comments