QBASIC PROGRAM TO CALCULATE TOTAL SURFACE AREA OF HEMISPHERE
CLS
INPUT “ENTER RADIUS ”; R
A= 3 * 3.14 * R ^ 2
PRINT “TOTAL SURFACE AREA OF HEMISPHERE "; A
END
USING SUB
DECLARE SUB HEMIAREA(R)
CLS
INPUT “ENTER RADIUS ”; R
CALL HEMIAREA(R)
END
SUB HEMIAREA(R)
A= 3 * 3.14 * R ^ 2
PRINT “TOTAL SURFACE AREA OF HEMISPHERE "; A
END SUB
USING FUNCTION
DECLARE FUNCTION HEMIAREA(R)
CLS
INPUT “ENTER RADIUS ”; R
PRINT “TOTAL SURFACE AREA OF HEMISPHERE "; HEMIAREA(R)
END
FUNCTION HEMIAREA(R)
HEMIAREA = 3 * 3.14 * R ^ 2
END FUNCTION
0 Comments