# C Program to Find Diameter, Circumference, and Area of a Circle

In this tutorial, i am going to show you how to find or calculate the diameter, circumference and area of a circle using the formula, function, and math modules in c programs.

## All C Programs and Algorithm to Find the Area of a Circle

• Algorithm To Find Diameter, Circumference, and Area of a Circle
• C Program to Find Diameter, Circumference, and Area of a Circle using Formula
• C Program to Find Diameter, Circumference, and Area of a Circle using Function
• C Program to Find Diameter, Circumference, and Area of a Circle using Math Module

### Algorithm To Find Diameter, Circumference, and Area of a Circle

Follow the below given algorithm to write a program to find diameter, circumference and area of a circle; as follows:

1. START PROGRAM.
2. TAKE RADIUS AS INPUT FROM USER.
3. FIND AREA OF DIAMETER, CIRCUMFERENCE, CIRLCE USING THE FOLLOWING FORMULAS:
1. diameter = 2 * radius;
2. circumference = 2 * PI * radius;
4. PRINT “AREA OF CIRCLE, DIAMETER, CIRCUMFERENCE “
5. END PROGRAM.

### C Program to Find Diameter, Circumference, and Area of a Circle using Formula

```/* C Program to find Diameter, Circumference, and Area Of a Circle */

#include<stdio.h>

#define PI 3.14

int main()
{

circumference = 2 * PI * radius;

printf("\n Diameter Of a Circle = %.2f\n", diameter);
printf("\n Circumference Of a Circle = %.2f\n", circumference);
printf("\n Area Of a Circle = %.2f\n", area);

return 0;
}```

The result of the above c program; as follows:

```Please Enter the radius of a circle : 5
Diameter Of a Circle = 10.00

Circumference Of a Circle = 31.40

Area Of a Circle = 78.50```

### C Program to Find Diameter, Circumference, and Area of a Circle using Function

```/* C Program to find Diameter, Circumference, and Area Of a Circle */
#include<stdio.h>
#include<math.h>
int main()
{

printf("\n Diameter Of a Circle = %.2f\n", diameter);
printf(" Circumference Of a Circle = %.2f\n", circumference);
printf(" Area Of a Circle = %.2f\n", area);

return 0;
}
{
}
{
}
{
}```

The result of the above c program; as follows:

```Please Enter the radius of a circle : 5
Diameter Of a Circle = 10.00
Circumference Of a Circle = 31.42
Area Of a Circle = 78.54
```

### C Program to Find Diameter, Circumference, and Area of a Circle using Math Module

```/**
* C program to calculate diameter, circumference and area of circle
*/
#include <stdio.h>
#include <math.h> // Used for M_PI
int main()
{

/*
* Input radius of circle from user
*/
/*
* Calculate diameter, circumference and area of circle
*/
circumference = 2 * M_PI * radius;
/*
* Print all results
*/
printf("Diameter of circle = %.2f units \n", diameter);
printf("Circumference of circle = %.2f units \n", circumference);
printf("Area of circle = %.2f sq. units ", area);
return 0;
}```

The result of the above c program; as follows:

```Enter radius of circle: 10
Diameter of circle = 20.00 units
Circumference of circle = 62.83 units
Area of circle = 314.16 sq. units ```