Wednesday, October 16, 2019

26. Qbasic program to calculate area of sphere


26.      Using Sub…… End Sub, write a program to calculate area of sphere. [ area = 4πr2]
DECLARE SUB TSAREA (R)
CLS
INPUT “ENTER RADIUS”; R
CALL TSAREA(R)
END

SUB TSAREA (R)
A= 4 * 3.14 * R ^ 2
PRINT “TOTAL SURFACE AREA OF SPHERE “; A
END SUB

1 comment: