用 C 程序查找圆的面积。
圆是一个封闭图形。圆上的所有点距离圆内的一点等距。中心点称为圆的中心。点到中心的距离称为半径。
面积是封闭图形尺寸跨度的定量表示。
圆的面积是指封闭在圆的尺寸内的面积。
计算圆面积的公式为:
Area = π*r*r
为了计算面积,我们将圆的半径作为输入并使用公式计算面积:
算法
STEP 1: Take radius as input from the user using std input. STEP 2: Calculate the area of circle using, area = (3.14)*r*r STEP 3: Print the area to the screen using the std output.
示例
使用的变量:
int r,圆的半径
float area,使用该公式计算的圆的面积。
#include <stdio.h>
int main(){
int r = 8;
float area = (3.14)*r*r;
printf("The area of the circle is %f",area);
return 0;
}输出
The area of the circle is 200.96
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP