C program to calculate area of circle

/* Calculate the area of a circle */

#include <stdio.h>
#define PI 3.141

int main() {
float r, a;

printf("Enter radius of the circle: ");
scanf("%f", &r);
a = PI * r * r;
printf("Area is %f\n", a);

getch();
return 0;
}
Advertisements