URI Online Judge | 1002
Area of a Circle
Adapted by Neilor Tonin, URI
Brazil
Timelimit: 1
Brazil
The area of the circle is defined as A = π . R2, having π as 3.14159.
Calculate the area using the formula given in the problem description.
Input
Read the variable R (double precision), that is the radius of the circle.
Output
Print the variable A, rounded to four decimal digits.
| Sample Inputs | Sample Outputs |
| 2.00 | A=12.5664 |
| 100.64 | A=31819.3103 |
| 150.00 | A=70685.7750 |
Solution:
#include <stdio.h>
int main()
{
double r,pi=3.14159;
scanf("%lf",&r);
printf("A=%.4lf\n",pi*r*r);
return 0;
}
int main()
{
double r,pi=3.14159;
scanf("%lf",&r);
printf("A=%.4lf\n",pi*r*r);
return 0;
}