Wednesday, October 16, 2019

21. Qbasic program to get radius of circle and then print its circumference.


21.      Write a program using SUB….END SUB to get radius of circle and then print its circumference. [C=2PR] 

DECLARE SUB CIRCUM (R)
CLS
INPUT “ENTER RADIUS”; R
CALL CIRCUM (R)
END

SUB CIRCUM (R)
C = 2 * 3.14 * R
PRINT “CIRCUMFERENCE OF CIRCLE ”; C
END SUB

1 comment: