Here you will get java program to calculate area and circumference of circle.
Formula used:
Area of Circle = 3.14 * radius2
Circumference of Circle = 2 * 3.14 * radius
import java.util.Scanner; public class Circle { public static void main(String args[]){ double radius, area, circumference; Scanner sc = new Scanner(System.in); System.out.println("Enter radius:"); radius = sc.nextDouble(); area = 3.14 * (radius * radius); circumference = 2 * 3.14 * radius; System.out.println("Area = " + area + "\nCircumference = " + circumference); } }
Output
Enter radius:
3.5
Area = 38.465
Circumference = 21.98