This program asks the user to enter the radius of the circle and displays the area and circumference of the circle on the basis of entered radius.

You need to know the formula for area and circumference of the circle (included below)

Variables :

1. **radius **: (Datatype int): to represent the radius of the circle.

2. **PI **: (Datatype float): static variable to represent constant PI value up to 3 decimal places i.e 3.142

3. **area **: (Datatype float): to store the result of the area of the circle being computed.

4. **circumference **: (Datatype float): to store the result of the circumference of the circle being computed.

Functions :

printf() : is used to display something on the console/screen. Format specifier %d in printf function is used to display a int variable on screen and %f to display float value. \n is used to add a newline

scanf() : is used to fetch data inputted by the user on the console/screen using the keyboard. %d in scanf is indicated that inputted text is of type int and %f for float value.

**Formula :**

**Area of Circle: π x r2**

**Circumfrence of Circle: 2 x π x r**

```
/*
* This is a C program to Calculate
* the Area and Circumference of
* Circle
*
*
*
* 4_calculate_area_and_circumfrence_of_circle.c
*
* Created on: Oct 20, 2014
* Author: Code2care.org
*/
#include <stdio.h>
//#include <conio.h>
void main() {
int radius;
static float PI = 3.142;
float area;
float circumfrence;
// clrscr();
printf("Program to calculate Area and Circumference of Circle : \n\n");
printf("Enter the radius of Circle : ");
scanf("%d", &radius);
area = PI*radius*radius;
circumfrence = 2*PI*radius;
printf("\n\nArea of circle with radius %d = %f \n\n",radius,area);
printf("Circumference of circle with radius %d = %f \n\n",radius,circumfrence);
// getch();
}
```

**Output :**

```
Program to calculate Area and Circumference of Circle :
Enter the radius of Circle : 5
Area of circle with radius 5 = 78.550003
Circumference of circle with radius 5 = 31.420000
```

The best way to learn C programming is to practice more and more programs. Code2care C Programming tutorials provide 1000+ programs in C that you can study and become an expert in the language. Programs are divided into categories depending upon type and complexity.

BSc. IT, BSc. Computer Science, BSc. IT, MSc. IT, MSc. Computer Science, MCA, BTech IT & BTech Engineers may find these programs very useful.

**More Posts related to C-program,**

- Calculate Volume of Cylinder
- Calculate Volume of Sphere
- Calculate Volume of Cube
- Calculate Volume of Ellipsoid
- Find Sum of two numbers
- Division between two numbers
- Calculate Area of Trapezoid
- Calculate Area of a Rectangle
- Calculate Volume of Pyramid
- Calculate Area of ellipse
- Find Difference of two numbers
- Calculate Volume of Cone
- Calculate Area of Square
- Calculate Area and Circumference of Circle
- Calculate Area of Parallelogram

**More Posts:**

- SharePoint An unexpected error has occurred - Correlation ID and Merge-SPlogfile - SharePoint
- MySQL : Error :1004 SQLSTATE: HY000 (ER_CANT_CREATE_FILE) Can't create file - MySQL
- [Solved] Bootstrap tooltip not working - Bootstrap
- Android Error Generating Final Archive - Debug Certificate Expired - Android
- No Android device found : Android File Transfer App Mac OS X - Android
- Simple Login Page using Bootstrap - Bootstrap
- JDK Location in Android Studio - Android-Studio
- How to word wrap in HTML - Html
- Setting up RSS feeds notifications within Outlook - HowTos
- How to change TextView or EditText Text Color on Focus and on Press - Android
- [Solved] com.sun.xml.ws.transport.http.servlet.WSServletContextListener ClassNotFoundException - Java
- vi undo command - Mac-OS-X
- How to send SMS on Android Emulator - Android
- Java XML-RPC java.net.BindException: Address already in use - Java
- Change Google Chrome Browsers default download location - Chrome