About Me

My photo
Raipur, Chhattisgarh, India
Hi , I am Amit Thakur. I have worked as a QA Engineer for two years and as a Java Developer for one year in NIHILENT TECHNOLOGIES PVT. LTD., Pune.Currently I am working as DEAN (Research & Development) in Bhilai Institute of Technology, Raipur.

Tuesday, August 27, 2013

C Program to find area and circumference of circle


#include<stdio.h>

int main()
{
int rad;
float PI=3.14,area,ci;

printf("Enter radius of circle: ");
scanf("%d",&rad);

area = PI * rad * rad;
printf("Area of circle : %f ",area);

ci = 2 * PI * rad;
printf("Circumference : %f ",ci);

return(0);
}

Output :

Enter radius of a circle : 1
Area of circle : 3.14
Circumference  : 6.28

No comments: