Loading [MathJax]/jax/output/HTML-CSS/jax.js

寻找圆形周长的C++程序


在本教程中,我们将讨论一个查找圆形周长的程序。

为此,我们将得到圆的半径。我们的任务是计算并打印该圆的周长。

示例

 现场演示

#include<bits/stdc++.h>
using namespace std;
#define PI 3.1415
double circumference(double r){
   double cir = 2*PI*r;
   return cir;
}
int main(){
   double r = 5;
   cout << "Circumference : " << circumference(r);
   return 0;
}

输出

Circumference : 31.415

更新日期:04-14-2020

347 次浏览

开始你的职业生涯

通过完成课程获得认证

开始
广告