Current location - Training Enrollment Network - Mathematics courses - Find the circumference and area of a circle by programming with C language.
Find the circumference and area of a circle by programming with C language.
The program code is as follows:

Compile directly, enter any radius r in the program output result, and the program execution result is shown in the following figure:

Extended data:

The circumference of a circle is a mathematical phenomenon that the n-polygon is inscribed in a circle, the side length is set to an, and the circumference of a regular n-polygon is n*an. When n is increasing, the perimeter of a regular polygon approaches the perimeter of a circle, that is, n approaches infinity, and C=n*an.

The formula of circular area is a theorem. Is the square of pi * radius, which can be expressed in letters as: S=πr? Or S=π*(d/2)? . (π stands for pi, r stands for radius and d stands for diameter).

Pi is the ratio of the circumference to the diameter of a circle, which is generally expressed by the Greek letter π and is a universal mathematical constant in mathematics and physics. π is also equal to the ratio of the area of a circle to the square of its radius. Accurate calculation of geometric shapes such as circle perimeter, circle area and sphere volume is the key value.