Wednesday, October 16, 2019

30. Qbasic program to find the total surface area of a box


30.      Write a program in QBASIC  to find the total surface area of a box using  FUNCTION….END FUNCTION.

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

1 comment: