Radius of a circle having area equal to the sum of area of the circles having given radii | C ++ implementation of the above approach ; Function to calculate radius of the circle having area equal to sum of the area of two circles with given radii ; Area of first circle ; Area of second circle ; Area of third circle ; Radius of third circle ; Driver Code ; Given radius ; Prints the radius of the required circle
#include <bits/stdc++.h> NEW_LINE using namespace std ; double findRadius ( double r1 , double r2 ) { double a1 , a2 , a3 , r3 ; a1 = 3.14 * r1 * r1 ; a2 = 3.14 * r2 * r2 ; a3 = a1 + a2 ; r3 = sqrt ( a3 / 3.14 ) ; return r3 ; } int main ( ) { double r1 = 8 , r2 = 6 ; cout << findRadius ( r1 , r2 ) ; return 0 ; }