定义符号常量计圆的面积,设半径为4.25,π的取值设为3.1415926,输出结果保留两位小数。C语言
时间: 2024-05-28 14:08:52 浏览: 152
圆的面积是:56.75。代码如下:
#include <stdio.h>
#define PI 3.1415926
#define RADIUS 4.25
int main() {
double area = PI * RADIUS * RADIUS;
printf("圆的面积是:%.2f", area);
return 0;
}
相关问题
定义符号常量计圆的面积,设半径为4.25,π的取值设为3.1415926,输出结果保留两位小数。
Sure, the area of the circle with a radius of 4.25 is defined as follows:
#define PI 3.1415926
#define RADIUS 4.25
double area = PI * RADIUS * RADIUS;
printf("The area of the circle is %.2f", area);
阅读全文