QBASIC Program To Find The Circumference Of Circle
Step1: Start
Step2: Accept/Input the radius of the circle and store it in the variable r
Step3: Calculate circumference = 2*(22/7)*r
Step4: Display the circumference of the circle
Step5: End the program
QBASIC Program To Find The Circumference Of Circle
CLS
INPUT “Enter radius”; R
C= 2*(22/7) * R
PRINT “The circumference of circle is ”; C
END
INPUT “Enter radius”; R
C= 2*(22/7) * R
PRINT “The circumference of circle is ”; C
END
Algorithm To Find The Circumference of Circle Using Sub Procedure in QBASIC
Step1: Start
Step2: Declare the sub procedure with a name and parameters as Circumference (r)
Step3: Accept/Input the radius of the circle and store it in the variable r
Step4: Call the sub procedure declared in the step2 with CALL statement as CALL Circumference (r)
Step5: End the program
Step6: Define the sub procedure
Step7: In the sub procedure, calculate the circumference of the circle
Step8: Display the circumference of the circle
Step9: End the sub procedure
Step1: Start
Step2: Declare the sub procedure with a name and parameters as Circumference (r)
Step3: Accept/Input the radius of the circle and store it in the variable r
Step4: Call the sub procedure declared in the step2 with CALL statement as CALL Circumference (r)
Step5: End the program
Step6: Define the sub procedure
Step7: In the sub procedure, calculate the circumference of the circle
Step8: Display the circumference of the circle
Step9: End the sub procedure
QBASIC Program To Find The Circumference Of Circle Using SUB procedure
DECLARE SUB Circum(R)
CLS
INPUT “Enter radius”; R
CALL Circum(R)
END
SUB Circum(R)
C= 2*(22/7) * R
PRINT “The circumference of circle is”; C
END SUB
CLS
INPUT “Enter radius”; R
CALL Circum(R)
END
SUB Circum(R)
C= 2*(22/7) * R
PRINT “The circumference of circle is”; C
END SUB
Algorithm To Find The Circumference of Circle Using Function Procedure in QBASIC
Step1: Start
Step2: Declare the function procedure with name and parameters as Circumference (r)
Step3: Accept/Input the radius of the circle and store it in the variable r
Step4: Call the function procedure declared in the step2 with a variable or PRINT Statement
Step5: End the program
Step6: Define the function procedure
Step7: In the function procedure, calculate the circumference of the circle
Step8: Assign the value of the circumference to the function name
Step9: End the function procedure
Step1: Start
Step2: Declare the function procedure with name and parameters as Circumference (r)
Step3: Accept/Input the radius of the circle and store it in the variable r
Step4: Call the function procedure declared in the step2 with a variable or PRINT Statement
Step5: End the program
Step6: Define the function procedure
Step7: In the function procedure, calculate the circumference of the circle
Step8: Assign the value of the circumference to the function name
Step9: End the function procedure
QBASIC Program To Find The Circumference Of Circle Using FUNCTION procedure
DECLARE FUNCTION Circum(R)
CLS
INPUT “Enter radius”; R
PRINT"The circumference of a circle is "; Circum(R)
END
FUNCTION Circum(R)
C= 2*(22/7) * R
Circum=C
END FUNCTION
CLS
INPUT “Enter radius”; R
PRINT"The circumference of a circle is "; Circum(R)
END
FUNCTION Circum(R)
C= 2*(22/7) * R
Circum=C
END FUNCTION
Comments
Post a Comment