Java Program for Program to find area of a circle

Area of a circle can simply be evaluated using following formula.

Area = pi * r2
where r is radius of circle 

Java

filter_none

edit
close

play_arrow

link
brightness_4
code

// Java program to find area
// of circle
      
class Test
{
    static final double PI = Math.PI;
           
    static double findArea(int r)
    {
       return PI * Math.pow(r, 2);
    }
           
    // Driver method
    public static void main(String[] args) 
    {
        System.out.println("Area is " +  findArea(5));
    }
}

chevron_right


Please refer complete article on Program to find area of a circle for more details!



My Personal Notes arrow_drop_up


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.