C program that reads in the radius of a circle and prints the circle’s diameter, circumference and area.

Write a program that reads in the radius of a circle and prints the circle’s diameter, circumference and area. Use the constant value 3.14159 for π. Perform each of these calculations inside the printf statement(s) and use the conversion specifier %f.

#include <stdio.h>

int main()
{
float radius; //defining variable radius
floatconst PI = 3.14159; //constant PI value
printf(“Enter the radius of the circle: “); //prints the prompt statement
scanf(“%f”, &radius); //takes the radius of the circle
printf(“\nMeasurement of the circle is given below:\n”); //header for the output values
printf(“Diameter: %.2f\n”, radius*2); //prints the diameter of the circle
printf(“Circumference: %.2f\n”, 2*PI*radius); //prints the circumference of the circle
printf(“Area: %.2f\n”, PI*radius*radius); //prints the area of the circle

return 0;
}
P