QBasic Programming

Display total surface area of cuboid / box

REM PROGRAM TO DISPLAY TOTAL SURFACE AREA OF CUBOID / BOX
CLS
INPUT “ENTER LENGTH”; L
INPUT “ENTER BREADTH”; B
INPUT “ENTER HEIGHT”; H
T= 2 * (L * B + B * H + H * L)
PRINT “TOTAL SURFACE AREA OF CUBOID“; T
END

USING SUB PROCEDURE

DECLARE SUB TSAREA (L, B, H)
CLS
INPUT “ENTER LENGTH”; L
INPUT “ENTER BREADTH”; B
INPUT “ENTER HEIGHT”; H
CALL TSAREA(L, B, H)
END

SUB TSAREA (L, B, H)
T= 2 * (L * B + B * H + H * L)
PRINT “TOTAL SURFACE AREA OF CUBOID “; T
END SUB

USING FUNCTION PROCEDURE

DECLARE FUNCTION TSAREA (L, B, H)
CLS
INPUT “ENTER LENGTH”; L
INPUT “ENTER BREADTH”; B
INPUT “ENTER HEIGHT”; H
PRINT “TOTAL SURFACE AREA OF CUBOID”; TSAREA(L, B, H)
END

FUNCTION TSAREA (L, B, H)
TSAREA = 2 * (L * B + B * H + H * L)
END FUNCTION

Display total surface area and volume of cylinder (Prev Lesson)
(Next Lesson) Display volume of cuboid / box
Back to QBasic Programming

No Comments

Post a Reply

Course Curriculum

error: Content is protected !!