计算内接于正方形的圆的面积的程序
内接于正方形的圆是指两端与正方形的边相切的圆。即内接圆的直径等于正方形的边长。使用公式可以计算面积“((π/4)*a*a)”,其中“a”是正方形的边长。

代码逻辑 - 使用公式((π/4)*a*a) 来计算内接圆的面积,为此我们需要定义数学上为 22/7 或 3.14 的π(π)的值。计算结果的表达式保存在一个浮点变量中。
示例
#include <stdio.h>
#include <math.h>
int main() {
int a = 5;
float area;
float pie = 3.14;
printf("Program to find area of circle inscribed inside a square
");
printf("The side of the square is %d
", a);
area = ((pie/4)*a*a);
printf("The area of circle inscribed inside a square is %f
", area);
return 0;
}输出
The side of the square is 5 The area of circle inscribed inside a square is 19.625000
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP