# Program to find Circumference of a Circle

Given radius of a circle, write a program to find its circumference.

Examples :

```Input : 2
Output : Circumference = 12.566

Input : 8
Output : Circumference = 50.264
```

## Recommended: Please try your approach on {IDE} first, before moving on to the solution.

In a circle, points lie in the boundary of a circle are at same distance from its center. This distance is called radius. Circumference of a circle can simply be evaluated using following formula.

```Circumference = 2*pi*r
where r is the radius of circle
and value of pi = 3.1415.
``` ## C++

 `// CPP program to find circumference of circle ` `#include ` `using` `namespace` `std; ` ` `  `#define PI 3.1415 ` ` `  `double` `circumference(``double` `r) ` `{ ` `    ``double` `cir = 2*PI*r; ` `    ``return` `cir; ` `} ` ` `  `// driver function ` `int` `main() ` `{ ` `  ``double` `r = 5; ` `  ``cout << ``"Circumference = "`  `       ``<< circumference(r); ` `  ``return` `0; ` `}  `

## Python3

 `# Python3 code to find  ` `# circumference of circle ` ` `  `PI ``=` `3.1415` ` `  `# utility function ` `def` `circumference(r): ` `    ``return` `(``2` `*` `PI ``*` `r) ` ` `  ` `  `# driver function ` `print` `(``'%.3f'` `%` `circumference(``5``)) ` ` `  `# This code is contributed by Saloni Gupta `

## Java

 `// Java program to find circumference of circle ` `import` `java.io.*; ` ` `  `class` `Geometry { ` `     `  `    ``// utility function ` `    ``static` `double` `circumference(``double` `r){ ` ` `  `        ``double` `PI = ``3.1415``; ` `        ``double` `cir = ``2``*PI*r; ` `        ``return` `cir; ` `    ``} ` `     `  `    ``// driver function ` `    ``public` `static` `void` `main (String[] args) { ` ` `  `        ``double` `r = ``5``; ` `        ``double` `result = Math.round(circumference(r) * ``1000``) / ``1000.0``; ` `        ``System.out.println(``"Circumference = "``+ result); ` `    ``} ` `} ` ` `  `// This article is contributed by Chinmoy Lenka `

## C#

 `// C# program to find circumference of circle ` `using` `System; ` ` `  `class` `GFG { ` `     `  `    ``// utility function ` `    ``static` `double` `circumference(``double` `r){ ` ` `  `        ``double` `PI = 3.1415; ` `        ``double` `cir = 2*PI*r; ` `        ``return` `cir; ` `    ``} ` `     `  `    ``// driver function ` `    ``public` `static` `void` `Main () { ` ` `  `        ``double` `r = 5; ` `        ``double` `result = ` `              ``Math.Round(circumference(r) ` `                        ``* 1000) / 1000.0; ` `                         `  `        ``Console.WriteLine(``"Circumference = "` `                                  ``+ result); ` `    ``} ` `} ` ` `  `// This article is contributed by anuj_67. `

## PHP

 ` `

Output :

```Circumference = 31.415
```

This article is contributed by Saloni Gupta . If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up

Improved By : jit_t, vt_m

Article Tags :
Practice Tags :

Be the First to upvote.

Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.