In this program, we are going to share Java program to calculate area of a circle. If you are a Java beginner and want to start learning the Java programming, then keep your close attention in this tutorial as I am going to share how to write a Java program to calculate an area of a circle.
Copy the below Java program and execute it with the help of Javac compiler. At the end of this program, We have shared the output of this program.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import java.util.Scanner; public class AreaCircle { public static void main(String[] args) { double radius; Scanner sc=new Scanner(System.in); // enter the radius of any circle System.out.print("Enter the Radius of Circle : "); radius=sc.nextDouble(); double area=3.14*radius*radius; System.out.print("Area of Circle : "+area); } } |
Enter the Radius of Circle : 10.5
Area of Circle : 346.185
Liked this program? Do Like & share with your friends 🙂
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.
Article Tags: circle class java program, Java exercises: Find the area and perimeter of a circle, java program for area of triangle, Java Program to calculate area and circumference of circle, Java Program To Calculate Area Of Circle, java program to find area of rectangle, java program to find area of square, Java programs, Java programs with examples, Java programs with output