Wednesday, October 16, 2019

22. Qbasic program to get radius of the circle and display the area.

22.      Write a program using FUNCTION….END FUNCTION to get radius of the circle and display the area.

DECLARE FUNCTION AREA (R)
CLS
INPUT “ENTER RADIUS”; R
PRINT “AREA OF CIRCLE ”; AREA(R)
END

FUNCTION AREA (L, B)
A = 3.14 * R ^ 2
AREA = A
END FUNCTION

No comments:

Post a Comment