Pie Are Squared
Limits
1s, 512 MB
Given the radius of a circle, calculate and print its area.
The area of a circle can be computed using the following formula:
For pi, you can use 3.141592653589793, or
The area of a circle can be computed using the following formula:
For pi, you can use 3.141592653589793, or
acos(-1)
.Input
The input will contain one floating point number r (r < 2000).
Output
Print the area of the circle (accurate to 10-4).
Sample
Input | Output |
---|---|
2 |
12.5663706144
Solution:
#include<stdio.h>
#include<math.h>
int main()
{
double r;
scanf("%lf",&r);
printf("%.10lf\n",M_PI*r*r);
}