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