1import java.util.Scanner;
2public class CalculateAreaOfCircle
3{
4 public static void main(String[] args)
5 {
6 double radius;
7 double pi = 3.1415, area;
8 Scanner sc = new Scanner(System.in);
9 System.out.println("Please enter radius of circle: ");
10 radius = sc.nextDouble();
11 area = pi * radius * radius;
12 System.out.println("Area of circle: " + area);
13 sc.close();
14 }
15}
1import java.util.Scanner;
2public class AreaOfCircle {
3 public static void main(String args[]){
4 int radius;
5 double area;
6 Scanner sc = new Scanner(System.in);
7 System.out.println("Enter the radius of the circle ::");
8 radius = sc.nextInt();
9 area = (radius*radius)*Math.PI;
10 System.out.println("Area of the circle is ::"+area);
11 }
12}