Function that calculates the area of a circle.

PHOTO EMBED

Thu Apr 25 2024 09:05:42 GMT+0000 (Coordinated Universal Time)

Saved by @kervinandy123 #c

#include <stdio.h>

float area(float r);

int main() {
    float radius, AOC;
    printf("--Area of Circle--\n");
    printf("Enter the radius of the circle:");
    scanf("%f", &radius);
    
    AOC=area(radius);
    printf("The area of the circle is %.2f", AOC);

}
float area(float r)
{
return(3.14159265359*r*r);
}
content_copyCOPY