How do you find the radius of a circle in C?
The following code example will prompt the user to provide the circumference of the circle, then print the diameter, radius, and area.Code Example:#include #define fPI 3.141593F int main(void) { float fCircumference = 0.0; float fDiameter = 0.0; float fRadius = 0.0; float fArea = 0.0; printf("Enter the circumference of the circle: "); scanf("%f", &fCircumference); fDiameter = fCircumference / fPI; fRadius = fDiameter / 2; /* fCircumference / (fPI * 2) */ fArea = (fRadius * fRadius) * fPI; /* (fRadius 'squared') * fPI */ printf( "The circles diameter is: %f\n" "The circles radius is: %f\n" "The circles area is: %f\n", fDiameter, fRadius, fArea ); return 0; }