C Language program to calculate circle circumference

Views: 140   

Following program shows you how to calculate circle circumference.
In this program we get circle radius from user and calculate circumference using following formula
Circumference = 2 X PI X r

#include <stdio.h>

int main(void) {
    float circleRadius;

    printf("Please enter the radius of circle:");
    scanf("%f", &circleRadius);

    float circumferenceOfCircle = 2 * 3.14 * circleRadius;

    printf("Circumference of circle is: %f ", circumferenceOfCircle);


Please enter the radius of circle: 4
Circumference of circle is: 25.120001
On By