QBasic Programming

Display volume of cube

REM PROGRAM TO DISPLAY VOLUME OF CUBE
CLS
INPUT “ENTER LENGTH”; L
V = L ^ 3
PRINT “VOLUME OF CUBE ”; V
END

USING SUB PROCEDURE

DECLARE SUB VOLUME(L)
CLS
INPUT “ENTER LENGTH”; L
CALL VOLUME(L)
END

SUB VOLUME (L)
V = L ^ 3
PRINT “VOLUME OF CUBE ”; V
END SUB

USING FUNCTION PROCEDURE

DECLARE FUNCTION VOLUME (L)
CLS
INPUT “ENTER LENGTH”; L
PRINT “VOLUME OF CUBE  ”; VOLUME(L)
END

FUNCTION VOLUME (L)
VOLUME = L ^ 3
END FUNCTION

Display total surface area of cube (Prev Lesson)
(Next Lesson) Display total surface area and volume of cube
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 !!