WRITE A QBASIC PROGRAM TO FIND CIRCUMFERENCE OF CIRCLE(SUB)

QBASIC PROGRAM TO FIND CIRCUMFERENCE OF CIRCLE


QBASIC PROGRAM TO FIND CIRCUMFERENCE OF CIRCLE(SUB)


Solution:-

Here we are using the formula C = 2 * 22/7 * R to find the circumference of a circle in Qbasic using Sub Procedure. 

You can also check the Functional Procedure to find the Circumference of the circle in this Post.


DECLARE SUB CIR(R)
CLS
INPUT"ENTER RADIUS"; R
CALL CIR(R)
END

SUB CIR(R)
C= 2 * 22/7 * R
PRINT"CIRCUMFERENCE OF CIRCLE"; C
END SUB