Area.java

Aim:

To find Area of circle

Source code:

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

Output:

Enter radius of the circle
10
area of circle=314.0





No comments:

Post a Comment