#include<stdio.h>
#include<conio.h>
#include<math.h>
//define pi 3.14
void main(){
const float pi=3.14;
float r,area,cir;
clrscr();
printf("enter radius of a circle\n");
scanf("%f",&r);
area=pi*r*r;
cir=2*pi*r;
printf("area of circle=%f\n and circumference of circle=%f",area,cir);
getch();
}
#include<conio.h>
#include<math.h>
//define pi 3.14
void main(){
const float pi=3.14;
float r,area,cir;
clrscr();
printf("enter radius of a circle\n");
scanf("%f",&r);
area=pi*r*r;
cir=2*pi*r;
printf("area of circle=%f\n and circumference of circle=%f",area,cir);
getch();
}
Area of Circle = PI X Radius X Radius.
ReplyDeleteWhere, Where PI is a constant which is equal to 22/7 or 3.141(approx)
And Circumference or Circle = 2 X PI X Radius
C++ Program to Find Circumference of Circle