Algorithm to Find the Area of a Circle
Algorithm to Find the Area of a Circle
In this tutorial, we will learn how to write and develop an algorithm and flowchart to find the area of a circle of radius r. The problem to solve is to find the area of the circle.
The mathematical formula to compute the area of the circle is:
area = pi*r*r
IPO chart
Let’s analyze the inputs and the expected outputs of the program.
Input, Process, and Output chart.
Input | Process | Output |
The radius of the circle(r) | Area = pi * r * r | Area of the circle(Area) |
Algorithm
Input: Radius r of the Circle.
Output: Area of the Circle
- Step 1: Start
- Step 2: Read the radius r of the circle
- Step 3: Compute the Area as per the formula. PI*r*r
- Step 4: Print the area of the circle
- Step 5: Stop
Pseudocode
The pseudocode for the algorithm is as follows:
START
DECLARE Real r
DECLARE Real area
OUTPUT "Enter the circle radius="
INPUT r
ASSIGN area = PI*r*r
OUTPUT "Area of the circle with radius " & r & " = " & area
END
Flowchart
Let’s develop the flowchart for the given problem:
Sample Run
Execute the flowchart and verify its output.
That’s it. We have successfully designed an algorithm & flowchart to compute the area of the given circle.
—
Flowgorithm Tutorials
You can find tutorials for the Flowgorithm flowchart tool on this website at:
Flowgorithm Website
For more information, visit the official website of Flowgorithm.