Like us on Facebook to get the latest links daily

Tuesday, December 20, 2011

C program to find the area of a circle



/* Write a C program to find the area of a circl, given the adius*/

#include <stdio.h>
#include <conio.h>
#include <math.h>
#define PI 3.142

void main()
{
float radius, area;
clrscr();

   printf("Enter the radius of a circle\n");
scanf ("%f", &radius);

area = PI * pow (radius,2);

printf ("Area of a circle = %f\n", area);
}

/*-----------------------------
Output

RUN1
Enter the radius of a circle
3.2
Area of a circle = 32.17

RUN 2
Enter the radius of a circle
6
Area of a circle = 113.11

------------------------------*/


Get E-mail Subscription for Latest Updates


Don't forget to Click on activation link , sent to your E-mail ID

No comments:

Post a Comment

You might also like:

Related Posts Plugin for WordPress, Blogger...