REM PROGRAM TO DISPLAY 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 PROCEDURE

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

USING FUNCTION PROCEDURE

DECLARE FUNCTION VOLUME (R, H)

CLS

INPUT “ENTER RADIUS”; R

INPUT “ENTER HEIGHT”; H

PRINT “VOLUME OF CYLINDER ”; VOLUME(R, H)

END

FUNCTION VOLUME (R, H)

VOLUME = 3.14 * R ^ 2 * H

END FUNCTION

## No Comments