Program to calculate the area between two Concentric Circles | Java program to find area between the two given concentric circles ; Function to find area between the two given concentric circles ; Declare value of pi ; Calculate area of outer circle ; Calculate area of inner circle ; Difference in areas ; Driver code
import java . io . * ; class GFG { static double calculateArea ( int x , int y ) { double pi = 3.1415926536 ; double arx = pi * x * x ; double ary = pi * y * y ; return arx - ary ; } public static void main ( String [ ] args ) { int x = 2 ; int y = 1 ; System . out . println ( calculateArea ( x , y ) ) ; } }