# Java Program to find Diameter, Circumference, and Area of a Circle

Write a Java Program to find the Diameter, Circumference, and Area of a circle with an example. This example allows entering the circle radius and finding the diameter, area, and circumference using a math formula.

• Diameter of a Circle = 2 * radius
• Area of a Circle = π * radius2
• Circumference of a Circle = 2 * π * radius
```package Area;

import java.util.Scanner;

public class DCAOfCricle1 {

private static Scanner sc;

public static void main(String[] args) {
sc = new Scanner(System.in);
double radius, diameter, area, circumference;

System.out.print("Please Enter the Circle radius = ");

diameter = 2 * radius;
area = Math.PI * radius * radius;
circumference = 2 * Math.PI * radius;

System.out.println("\nArea of a Circle        = " + area);
System.out.println("Diameter of a Circle      = " + diameter);
System.out.println("Circumference of a Circle = " + circumference);
}
}```

This program declared a calcDiameter, calcArea, and calCircumference functions that return the Circle Diameter, Circumference, and Area.

```package Area;

import java.util.Scanner;

public class DCAOfCricle2 {

private static Scanner sc;

public static void main(String[] args) {
sc = new Scanner(System.in);

double radius, diameter, area, circumference;

System.out.print("Please Enter the Circle radius = ");

System.out.println("\nArea of a Circle        = " + area);
System.out.println("Diameter of a Circle      = " + diameter);
System.out.println("Circumference of a Circle = " + circumference);
}

public static double calcDiameter(double radius) {
return 2 * radius;
}
public static double calcArea(double radius) {
``````Please Enter the Circle radius = 12