Area Of Circle In Java
Chapter:
Math Class
Last Updated:
04-05-2016 18:27:27 UTC
Program:
/* ............... START ............... */
import java.util.Scanner;
public class JavaAreaOfCircle {
static Scanner sc = new Scanner(System.in);
public static void main(String args[]) {
System.out.print("Please enter the radius of Circle: ");
double radius = sc.nextDouble();
double area = Math.PI * (radius * radius);
System.out.println("The area of circle : " + area);
}
}
/* ............... END ............... */
Output
Please enter the radius of Circle: 15
The area of circle : 706.8583470577034
Tags
Area Of Circle, Java, Math