Wednesday 30 October 2019

Qbasic to find Volume of Cylinder using Function

DECLARE FUNCTION VOL ( R, H )
CLS
INPUT "Enter radius"; R
INPUT "Enter height"; H
PRINT "Volume of cylinder"; VOL ( R, H )
END

FUNCTION VOL ( R, H )
VOL = 22 / 7 * r ^ 2 * H
END FUNCTION

No comments:

Post a Comment