# Find area of the larger circle when radius of the smaller circle and difference in the area is given

Given two integers **r** and **d** where **r** is the radius of the smaller circle and **d** is the difference of the area of this circle with some larger radius circle. The task is to find the area of the larger circle.

**Examples:**

Input:r = 4, d = 5

Output:55.24

Area of the smaller circle = 3.14 * 4 * 4 = 50.24

55.24 – 50.24 = 5

Input:r = 12, d = 3

Output:455.16

**Approach:** Let radius of the smaller and the larger circles be **r** and **R** respectively and the difference in the areas is given to be **d** i.e. **PI * R ^{2} – PI * r^{2} = d** where

**PI = 3.14**

Or,

**R**.

^{2}= (d / PI) + r^{2}Now, area of the bigger circle can be calculated as

**PI * R**.

^{2}Below is the implementation of the above approach:

## C++

`// C++ implementation of the approach ` `#include <bits/stdc++.h> ` `using` `namespace` `std; ` ` ` `const` `double` `PI = 3.14; ` ` ` `// Function to return the area ` `// of the bigger circle ` `double` `find_area(` `int` `r, ` `int` `d) ` `{ ` ` ` `// Find the radius of ` ` ` `// the bigger circle ` ` ` `double` `R = d / PI; ` ` ` `R += ` `pow` `(r, 2); ` ` ` `R = ` `sqrt` `(R); ` ` ` ` ` `// Calculate the area of ` ` ` `// the bigger circle ` ` ` `double` `area = PI * ` `pow` `(R, 2); ` ` ` `return` `area; ` `} ` ` ` `// Driver code ` `int` `main() ` `{ ` ` ` `int` `r = 4, d = 5; ` ` ` ` ` `cout << find_area(r, d); ` ` ` ` ` `return` `0; ` `} ` |

*chevron_right*

*filter_none*

## Java

`// Java implementation of the approach ` `class` `GFG ` `{ ` ` ` `static` `double` `PI = ` `3.14` `; ` ` ` ` ` `// Function to return the area ` ` ` `// of the bigger circle ` ` ` `static` `double` `find_area(` `int` `r, ` `int` `d) ` ` ` `{ ` ` ` `// Find the radius of ` ` ` `// the bigger circle ` ` ` `double` `R = d / PI; ` ` ` `R += Math.pow(r, ` `2` `); ` ` ` `R = Math.sqrt(R); ` ` ` ` ` `// Calculate the area of ` ` ` `// the bigger circle ` ` ` `double` `area = PI * Math.pow(R, ` `2` `); ` ` ` `return` `area; ` ` ` `} ` ` ` ` ` `// Driver code ` ` ` `public` `static` `void` `main(String[] args) ` ` ` `{ ` ` ` `int` `r = ` `4` `, d = ` `5` `; ` ` ` ` ` `System.out.println(find_area(r, d)); ` ` ` `} ` `} ` ` ` `// This code is contributed by PrinciRaj1992 ` |

*chevron_right*

*filter_none*

## Python3

`# Python 3 implementation of the approach ` `PI ` `=` `3.14` `from` `math ` `import` `pow` `, sqrt ` ` ` `# Function to return the area ` `# of the bigger circle ` `def` `find_area(r, d): ` ` ` ` ` `# Find the radius of ` ` ` `# the bigger circle ` ` ` `R ` `=` `d ` `/` `PI ` ` ` `R ` `+` `=` `pow` `(r, ` `2` `) ` ` ` `R ` `=` `sqrt(R) ` ` ` ` ` `# Calculate the area of ` ` ` `# the bigger circle ` ` ` `area ` `=` `PI ` `*` `pow` `(R, ` `2` `) ` ` ` `return` `area ` ` ` `# Driver code ` `if` `__name__ ` `=` `=` `'__main__'` `: ` ` ` `r ` `=` `4` ` ` `d ` `=` `5` ` ` ` ` `print` `(find_area(r, d)) ` ` ` `# This code is contributed by ` `# Surendra_Gangwar ` |

*chevron_right*

*filter_none*

## C#

`// C# implementation of the approach ` `using` `System; ` ` ` `public` `class` `GFG ` `{ ` ` ` `static` `double` `PI = 3.14; ` ` ` ` ` `// Function to return the area ` ` ` `// of the bigger circle ` ` ` `static` `double` `find_area(` `int` `r, ` `int` `d) ` ` ` `{ ` ` ` `// Find the radius of ` ` ` `// the bigger circle ` ` ` `double` `R = d / PI; ` ` ` `R += Math.Pow(r, 2); ` ` ` `R = Math.Sqrt(R); ` ` ` ` ` `// Calculate the area of ` ` ` `// the bigger circle ` ` ` `double` `area = PI * Math.Pow(R, 2); ` ` ` `return` `area; ` ` ` `} ` ` ` ` ` `// Driver code ` ` ` `static` `public` `void` `Main () ` ` ` `{ ` ` ` ` ` `int` `r = 4, d = 5; ` ` ` `Console.Write(find_area(r, d)); ` ` ` `} ` `} ` ` ` `// This code is contributed by ajit. ` |

*chevron_right*

*filter_none*

## PHP

`<?php ` `// PHP implementation of the approach ` `const` `PI = 3.14; ` ` ` `// Function to return the area ` `// of the bigger circle ` `function` `find_area(` `$r` `, ` `$d` `) ` `{ ` ` ` ` ` `// Find the radius of ` ` ` `// the bigger circle ` ` ` `$R` `= ` `$d` `/ PI; ` ` ` `$R` `+= pow(` `$r` `, 2); ` ` ` `$R` `= sqrt(` `$R` `); ` ` ` ` ` `// Calculate the area of ` ` ` `// the bigger circle ` ` ` `$area` `= PI * pow(` `$R` `, 2); ` ` ` `return` `$area` `; ` `} ` ` ` `// Driver Code ` `$r` `= 4; ` `$d` `= 5; ` ` ` `echo` `(find_area(` `$r` `, ` `$d` `)); ` ` ` `// This code is contributed by Naman_Garg ` `?> ` |

*chevron_right*

*filter_none*

**Output:**

55.24

## Recommended Posts:

- Program to calculate area of inner circle which passes through center of outer circle and touches its circumference
- Program to find area of a circle
- Given equation of a circle as string, find area
- Find the area of largest circle inscribed in ellipse
- Area of circle inscribed within rhombus
- Area of a Circumscribed Circle of a Square
- Area of square Circumscribed by Circle
- Area of decagon inscribed within the circle
- Area of circle which is inscribed in equilateral triangle
- Area of a circle inscribed in a regular hexagon
- Program to calculate area of an Circle inscribed in a Square
- Area of largest Circle inscribe in N-sided Regular polygon
- Radii of the three tangent circles of equal radius which are inscribed within a circle of given radius
- Find minimum radius such that atleast k point lie inside the circle
- Area of a square inscribed in a circle which is inscribed in an equilateral triangle

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.