
我们已知平行四边形的边,任务是生成具有给定边的平行四边形的周长并显示结果
平行四边形是一种二次方程,具有 -
下图所示的“a”和“b”是平行四边形的边,图中所示的边是平行的。

平行四边形的周长/周长定义为 −
平行四边形的周长 = 2(a + b)
= 2 * a + 2 * b
Input-: a = 23 and b = 12 Output-: Circumference of a parallelogram is : 70.00 Input-: a = 16.2 and b = 24 Output-: Circumference of a parallelogram is : 80.4
START Step 1-> Declare function to calculate circumference of parallelogram float circumference(float a, float b) return ((2 * a) + (2 * b)) Step 2-> In main() Declare float a = 23, b = 12 Call circumference(a, b) STOP
#include <stdio.h>
//function for circumference of parallelogram
float circumference(float a, float b) {
return ((2 * a) + (2 * b));
}
int main() {
float a = 23, b = 12;
printf("Circumference of a parallelogram is : %.2f", circumference(a, b));
return 0;
}Circumference of a parallelogram is : 70.00
以上就是平行四边形周长的C程序的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号