In this Tutorial we will learn to Java program to calculate the area and circumference of the circle. User will give radius as input and our program should return circumference and area.
If you don't know how to find circumference and area please refer below:
- The area of a circle is calculated using the formula 3.14*r*r where 3.14 is Pi value and r is the radius of circle
- The circumference of a circle is calculated using the formula 2*3.14*r.
- The java program below uses Math.PI property of java that return approx 3.14159
Program to find circumference of circle in java
Output:
Enter the radius:
6
The Area of the Circle is: 113.09733552923255
The circumference of a circle is: 37.69911184307752