Program to calculate the area between two Concentric Circles | C ++ 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 Program
#include <bits/stdc++.h> NEW_LINE using namespace std ; double calculateArea ( int x , int y ) { double pi = 3.1415926536 ; double arx = pi * x * x ; double ary = pi * y * y ; return arx - ary ; } int main ( ) { int x = 2 ; int y = 1 ; cout << calculateArea ( x , y ) ; return 0 ; }