C program to find the area and circumference of a circle. code example

Example 1: area and circumference of a circle

#include <stdio.h>
#define PI 3.142
int main(){
    float r, C, A;
    printf("What is the radius: \n");
    scanf("%f", &r);
    C = 2 * PI * r;
    A = PI * r * r;
    printf("\nCincumference is and %f Area is %f\n", C, A);
}

Example 2: c program to find area of circle

#include <stdio.h>
#define PI 3.142
int main(){
    float R, A;
    printf("Enter the radius: \n");
    scanf("%f", &R);
    A = PI * R * R;
    printf("Area is: %f\n", A);
    
}

Tags:

C Example