Problem Analysis:
The problem is to calculate the area of circle having input parameters radius(r).The output is to display the area of the circle.Here PI should be defined.
The formula to calculate the area of the circle is;
i.e. Area=PI *r *r
Input variables processing variables output variables Necessary header files
r(int) Area=PI*r*r Area(float) stdio.h
conio.h
define PI 3.14
Algorithm;
1.Start
2.Define PI 3.14
3.Input the radius of the circle by the user and assign as ;
i.e. int r;
4.Calculate the area of the circle by using formula.
5.print the value of Area.
6.End
Flowchart;
fig: flowchart to print area of the circle.
Code;
Outputs;
Compiling ,Debugging and Testing.
Enter r : 5
area = 78.500000