Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Selected Reading
C++ program to find circumference of the circular pond with radius R
Suppose we have a number R, represents the radius of a pond. We have to find the circumference of this pond.
So, if the input is like R = 73, then the output will be 458.67252742410977361942
Steps
To solve this, we will follow these steps −
res := r * 2 * cos-inverse (-1) return res
Let us see the following implementation to get better understanding
Example
Let us see the following implementation to get better understanding −
#include<bits/stdc++.h>
using namespace std;
double solve(int r){
double res = r * 2 * acos(-1);
return res;
}
int main(){
int R = 73;
cout << solve(R) << endl;
}
Input
73
Output
458.673
Advertisements
