Home / Programs / Program to find area and circumference of circle.
Programming Example

Program to find area and circumference of circle.

👁 1,538 Views
💻 Practical Program
📘 Step by Step Learning
This program calculates area and circumference of a circle.

Program Code

/* Documentation Section
program: Program to find area and circumference of circle.
author: atnyla developer
*/

#include<stdio.h>
#include<conio.h>
void main()
{
int r;
float pi=3.14,area,ci; 
	printf("enter radius of circle: \n");
	scanf("%d",&r);
	area=pi*r*r;
	printf("area of circle=%f \n",area);
	ci=2*pi*r;
	printf("circumference=%f \n",ci);
 
}

Output

enter radius of circle:
5
area of circle=78.500000
circumference=31.400002
Press any key to continue . . .

Explanation

Formula to calculate area of circle area=pi*r*r; Formula to calculate circumference of circle ci=2*pi*r;

How to learn from this program

First read the algorithm, then study the program code line by line. After that, compare the code with the output and finally go through the explanation. This approach helps learners understand both the logic and the implementation properly.