Write a program to read the radius of a circle and compute its Area and Circumference
[showmyads]/* A program to read the radius of a circle and compute its area and circumference
programmed by:
Name: Jitendra Kumar Yadav
Roll no: 16
Date: 07 jan 2011 */
#include <stdio.h>
#include <conio.h>
#include <math.h> // to apply the power rule of mathematic
void main()
{
float A,C,r;//Area may be apter decimal because radius may in decimal
printf(“Enter the radius of a circle: “);//Enter the radious for which area and circumference will be calculated
scanf(“%f”,&r);
A=((22*1.0)/7*pow(r,2));
C=(2*(22*1.0)/7*r);
printf(“The area of a circle is %f”,A);
printf(“\nThe circumference of a circle is %f”,C);
getch();
}
Comments (14)