C Program to calculate Area and Circumference of Circle
In this program, I have discussed about the C Program to calculate Area and Circumference of Circle
Area of a circle= 3.14*(radius)^2
Perimeter of a circle= 2*3.14*(radius)
----------------------------------------------------
#include<stdio.h>
void main()
{float r,p,a;
printf("Enter the radius of the circle:");
scanf("%f",&r);
p=2*3.14*r;
a=3.14*r*r;
printf("The perimeter is : %.2f \n",p);
printf("The area is : %.2f \n",a);
}
-------------------------------------------------
Just copy and paste the program in your desired compiler (Dev C++ is more preferable) and run it.
Enjoy programming in C.
0 comments:
Post a Comment