Find the Circumference of a Circle – Java Program

Area of a circumference = 2πR

Where π = 3.14 and R = radius of circle

Circumference of Circle

Example:

Radius = 4.0
Area = 2*π*radius = 2*3.14*4 = 25.12

Java Code:

public class CircumferenceOfCircle {
public static void circumference(double radius){
double pi = 3.14;
double circumference = 2*pi*radius;
System.out.println("Area of circumference with radius="+radius + " is: " + circumference);
}
public static void main(String[] args) {
double radius = 4;
circumference(radius);
}
}

Output:

Area of circumference with radius=4.0 is: 25.12