Basics

Java Program to Calculate Area of Circle

Area of Circle

We may calculate the area of Circle using Java Program.

Formula we are applying here is Area = 3.14*radius*radius

/**
 * @(#)Circle.java
 * @program  : Java Program to calculate area of Circle
 * @author     : Arun Kumar Murmu
 * @version    : 1.00
 */


import java.io.*;
import java.util.*;

public class Circle 
{
    public static void main(String arg[ ]) 
    {
     Scanner sc = new Scanner(System.in);
     int r;
     double area;
     System.out.println("Enter radius =");
     r = sc.nextInt();
     area = 3.14*r*r;
     System.out.println("Area of Circle ="+area);
    }
}
Output : 

Enter radius = 6
Area of Circle =113.03999999999999

Process completed.

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

To Top