Write a function that calculates the area of a circle.
Wed May 01 2024 06:36:57 GMT+0000 (Coordinated Universal Time)
Saved by
@JC
#include <stdio.h>
float circle(float radius) {
float area;
area = 3.14 * radius * radius;
return area;
}
int main() {
float radius, area;
printf("Enter the radius: ");
scanf("%f", &radius);
area = circle(radius);
printf("The area of the circle is: %.2f\n", area);
return 0;
}
content_copyCOPY
Comments