C language, the input radius of the circle, and the output of the perimeter area of a circle

#include <stdio.h>

/**
    Requirements: Enter the radius of the circle, and the output of the perimeter area of ​​a circle
*/

int main(void)
{
    /**
        Declare a variable of type float radius to obtain the value of the radius; Area to represent the area, perimeter represented perimeter
    */

    float radius;
    float area;
    float perimeter;
    the printf ( " ---- input to calculate the radius of the circle area and perimeter ---- \ n- " );
    printf ( " Please enter the radius of the circle: " );
    scanf("%f",&radius);

    // calculate the area of a circle 
    Area = 3.1415926 * (* RADIUS RADIUS);

    // calculate the circumference of a circle 
    Perimeter = 2 * RADIUS * 3.1415926 ;

    the printf ( " area of a circle is: F% \ n- " , Area);
    the printf ( " perimeter of a circle is: F% \ n- " , Perimeter);

    return 0;

}

 

 

Guess you like

Origin www.cnblogs.com/starshine-zhp/p/12370120.html