Programing problem : Toph-Easyproblem-Pie Are Squared
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
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).
Solution : Code in C language
#include<stdio.h> int main(){ int r; double pi=3.141592653589793,area; scanf("%d",&r); area=pi*r*r; printf("%f",area); return 0; }
0 Comments:
Post a Comment