In this tutorial, we will be discussing a program to find circumference of a circle.
For this we will be provided with the radius of the circle. Our task is to calculate and print the circumference of that circle.
Example
#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;
}Output
Circumference : 31.415