Program to find area and circumference of circle.

C Programming Language Overview of C Language (Article) Overview of C Language (Program)

1432

Program:

/* 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;

This Particular section is dedicated to Programs only. If you want learn more about C Programming Language. Then you can visit below links to get more depth on this subject.