Preview:
#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;
}
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter