6. C Program to find Area and Circumference of a circle.
How does this program work?
- In this program you will learn about how to calculate Area and Circumference of a circle.
- This program requires the user input to enter the Radius of a circle.
- This program perform mathematical calculation and display the result using C language.
Here is the code
#include <stdio.h>
int main(void)
{
int r; //Initialise the varibles
float pi=3.14,area,cir;
printf("Enter the Radius of a Circle:\n");
scanf("%d",&r); //To store the enter value
area=pi*r*r; //Equation for area of a circle
printf("Area of a Circle is: %f\n",area);
cir=2*pi*r; //Equation for Circumference of a circle
printf("Circumference of a circle is: %f",cir);
return 0;
}