C program to find area and circumference of circle when radius is given.

#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();
}

1 comment:

  1. Area of Circle = PI X Radius X Radius.
    Where, 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

    ReplyDelete