# Java program to find circumference of a circle

Let’s learn java program to find circumference of a circle.

## Java program to find circumference of a circle

To calculate circumference of circle in java, first we have to get radius of circle from user using nextInt() method of Scanner class.

This user entered number is stored in integer variable “radius”. Then find circumference of a circle using below formula.

To find circumference of a circle formula is,

circumference = 2πr

Circumference of circle is twice the product of radius and value of PI.

This product is stored in double variable “circumference”.

Lastly circumference is printed on console. Here’s the java program to calculate circumference of circle.

```import java.util.Scanner;
public class CircumferenceOfCircleJava
{
public static void main(String[] args)
{
double circumference;
Scanner sc = new Scanner(System.in);
circumference = Math.PI * 2 * radius;
System.out.println("Circumference of circle : " + circumference);
sc.close();
}
}

```

Output:

Circumference of circle : 62.83185307179586

Also read – java program to find area of rectangle

Also read – java program to find area of circle

java program to find perimeter of a circle

Here’s java program to find perimeter of a circle.

```import java.util.Scanner;
public class PerimeterOfCircle
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);