C Program to find Diameter, Circumference and Area of Circle

Write C Program to find Diameter, Circumference and Area of Circle

//Write a C program to find Diameter,Circumference and Area of Circle

#include <stdio.h>
#define PI 3.14

int main()
{
    float radius, area, diameter, circumference;

    printf("Enter radius of circle :--> ");
    scanf("%f", & radius);

	diameter = 2 * radius;			 // Diameter Formula
	circumference = 2 * PI * radius; //Circumference Formula
    area = PI * radius * radius;     //area of circle Formula

    printf("Area of circle is :--> %0.2f\n", area);
	printf("The Diameter of the circle is :--> %0.2f\n",diameter);
	printf("The Circumference of the circle is :--> %0.2f\n",circumference);

    return 0;
}

Output:

Enter radius of circle :--> 12

Area of circle is :--> 452.16
The Diameter of the circle is :--> 24.00
The Circumference of the circle is :--> 75.36

≪ Previous | Next ≫