C program to find the area of a circle, given the radius

by Nideesh C on April 11, 2011 · 1 comment

in C Programming




/*  C program to find the area of a circle, given the radius*/

#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 = %5.2f\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

——————————*/

Not Satisfied ? Just search & get the result

Related Posts Plugin for WordPress, Blogger...
Be Sociable, Share!

Related posts:

  1. C program to find the area of a triangle, given three sides
  2. Sample – Program to draw circles.
  3. Sample – Program to change the foreground colors and draw circles on the screen.
  4. Sample – Program to find the roots of a quadratic equation.
  5. Sample – Program to find the sum of each row & column of a matrix of size n x m and if matrix is square, find the sum of the diagonals also..

{ 1 comment… read it below or add one }

1 Tilly April 14, 2011 at 8:30 pm

C program to find the area of a circle, given the radius

Reply

Leave a Comment

Previous post:

Next post: