Tuesday, September 8, 2009

C PROGRAM TO CALCULATE AREA OF A CIRCLE





C
program for area of circle



#include

#define PI 3.141

int main(){

float r, a;

printf("Radius: ");

scanf("%f", &r);

a = PI * r * r;

printf("%f\n", a);

return 0;

}



Mathematical
formula for area of circle:

























Here
Pie is constant which is equal to



Pie = 22/7 or
3.14159265358979323846264338327950288419716939937510...







No comments:

Post a Comment