QBasic Programming

Display volume of cylinder

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

Display total surface area of cylinder (Prev Lesson)
(Next Lesson) Display total surface area and volume of cylinder
Back to QBasic Programming
Notice: compact(): Undefined variable: limits in /home/bhimgautam34/public_html/wp-includes/class-wp-comment-query.php on line 853

Notice: compact(): Undefined variable: groupby in /home/bhimgautam34/public_html/wp-includes/class-wp-comment-query.php on line 853

No Comments

Post a Reply

Course Curriculum

error: Content is protected !!