Area of a circle

3.Write a program to find the area of a circle?
#include
#include
{
int r;
float a, area;
clrscr();
a=3.14;
printf("enter no.");
scanf(%d",&r);
area=a*r*r;
printf("result is %f",area);
getch();
}


Algorithum
1.start
2.read radius r and a
3.calculate area =a*r*r
4.print area
5.stop


Result
The program is sucessfully executed and desired output is obtained

Output
enter r
2
result =12.56

0 comments:

Post a Comment