在C ++中查找正方形和矩形的周长/周长的程序
在本教程中,我们将讨论一个程序,以查找正方形和矩形的周长/周长。
为此,我们将获得矩形或正方形的侧面。我们的任务是找到该正方形或矩形的周长/周长。
示例
#include <iostream>
using namespace std;
int Circumference(int l, int w) {
return (2 * (l + w));
}
int main() {
int l = 8, w = 8;
int c = Circumference(l, w);
cout << "Circumference is : "
<< c << endl;
return 0;
}输出结果
Circumference is : 32
热门推荐
10 接到英文简短老师祝福语
11 新年祝福语姨姨简短
12 钢琴获奖老师祝福语简短
13 中秋骚气祝福语简短情人
14 靳年祝福语大全简短
15 新年祝福语简短小猪
16 离别赠言离职祝福语简短
17 寿宴祝福语蛋糕文案简短
18 同事姐妹离别祝福语简短