Wednesday, October 16, 2019

28. Qbasic Program to calculate and print the volume of a box / cuboid.


28.      Write a program using Function Module to calculate and print the volume of a box / cuboid. [ V=L*B*H]

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

FUNCTION VOLUME (L, B, H)
VOLUME = L * B * H
END FUNCTION

2 comments: