Java program for area of circle

Java Program for area of circle 

import java.util.Scanner;
public class AreaOfCircle
{
   public static void main(String args[ ])
  {
     Scanner s=new Scanner(System.in)
      double r, area; 
     System.out.println("Enter the value of r");
    r=s.nextDouble();
    area=3.14*r*r;
   System.out.println("Area of circle :"+area); 
   }
}

Output 
Enter the value of r
5
Area of circle :78.5

Comments