- C++ Basics
- C++ Home
- C++ Overview
- C++ Environment Setup
- C++ Basic Syntax
- C++ Comments
- C++ Data Types
- C++ Variable Types
- C++ Variable Scope
- C++ Constants/Literals
- C++ Modifier Types
- C++ Storage Classes
- C++ Operators
- C++ Loop Types
- C++ Decision Making
- C++ Functions
- C++ Numbers
- C++ Arrays
- C++ Strings
- C++ Pointers
- C++ References
- C++ Date & Time
- C++ Basic Input/Output
- C++ Data Structures

- C++ Object Oriented
- C++ Classes & Objects
- C++ Inheritance
- C++ Overloading
- C++ Polymorphism
- C++ Abstraction
- C++ Encapsulation
- C++ Interfaces

# Area of the Largest square that can be inscribed in an ellipse in C++

Here we will see the area of largest square that can be inscribed in an ellipse. The square in ellipse will be like below −

The area of ellipse is −

Now, if x and y are same, then

So area is −

## Example

#include <iostream> #include <cmath> using namespace std; float area(float a, float b) { if (a < 0 || b < 0 ) //if values are is negative it is invalid return -1; float area = (4*(a*a + b*b)) / (a*a*b*b); return area; } int main() { float a = 4, b = 2; cout << "Area : " << area(a, b); }

## Output

Area : 1.25

- Related Articles
- Area of Largest rectangle that can be inscribed in an Ellipse?
- Find the area of largest circle inscribed in ellipse in C++
- Area of the largest triangle that can be inscribed within a rectangle?
- Find the area of the largest triangle that can be inscribed in a semi-circle of radius $r$ units, in square units.
- Area of largest triangle that can be inscribed within a rectangle in C Program?
- Find the area of the circle that can be inscribed in a square of side $6\ cm$.
- Find the area of the square that can be inscribed in a circle of radius $8\ cm$.
- Biggest Square that can be inscribed within an Equilateral triangle?
- Biggest Square that can be inscribed within an Equilateral triangle in C?
- Area of a triangle inscribed in a rectangle which is inscribed in an ellipse?
- Area of a triangle inscribed in a rectangle which is inscribed in an ellipse In C Program?
- Biggest Reuleaux Triangle inscribed within a square which is inscribed within an ellipse in C?
- Biggest Reuleaux Triangle inscribed within a square which is inscribed within an ellipse?
- Area of the biggest possible rhombus that can be inscribed in a rectangle in C?
- Program to calculate the area of an Circle inscribed in a Square

Advertisements