在本教程中,我们将讨论一个程序来查找圆的圆周。
为此,我们将获得圆的半径。我们的任务是计算并打印该圆的周长。
#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