# 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

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<bits/stdc++.h> ` `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; ` `} ` |

*chevron_right*

*filter_none*

## 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 ` |

*chevron_right*

*filter_none*

## 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 ` |

*chevron_right*

*filter_none*

## 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. ` |

*chevron_right*

*filter_none*

## PHP

`<?php ` `// PHP program to find ` `// circumference of circle ` ` ` `$PI` `= 3.1415; ` ` ` `function` `circumference(` `$r` `) ` `{ ` ` ` `global` `$PI` `; ` ` ` `$cir` `= 2 * ` `$PI` `* ` `$r` `; ` ` ` `return` `$cir` `; ` `} ` ` ` `// Driver Code ` `$r` `= 5; ` `echo` `"Circumference = "` `, ` `circumference(` `$r` `); ` ` ` `// This code is contributed aj_36 ` `?> ` |

*chevron_right*

*filter_none*

**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.

Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

## Recommended Posts:

- Program to calculate area of inner circle which passes through center of outer circle and touches its circumference
- Program to find Perimeter / Circumference of Square and Rectangle
- Program for Circumference of a Parallelogram
- Program to find area of a circle
- Program to find smallest difference of angles of two parts of a given circle
- Find area of the larger circle when radius of the smaller circle and difference in the area is given
- Program to print circle pattern
- Program to calculate area of an Circle inscribed in a Square
- Program to calculate angle on circumference subtended by the chord when the central angle subtended by the chord is given
- Find the other-end coordinates of diameter in a circle
- Find the center of the circle using endpoints of diameter
- Given equation of a circle as string, find area
- Find the Diameter or Longest chord of a Circle
- Find the area of largest circle inscribed in ellipse
- Find minimum radius such that atleast k point lie inside the circle