Find the Area of an Ellipse in C++



In this tutorial, we will be discussing a program to find the area of an Ellipse.

For this, we will be provided with the semi-major axis and semi-minor axis of the Ellipse. Our task is to calculate and print out the area of the given Ellipse.

Example

 Live Demo

#include<bits/stdc++.h>
using namespace std;
//finding area of ellipse
void findArea( float a, float b) {
   float Area;
   Area = 3.142 * a * b ;
   cout << "Area: " << Area;
}
int main() {
   float a = 5, b = 4;
   findArea(a, b);
   return 0;
}

Output

Area: 62.84
Updated on: 2020-06-02T11:24:20+05:30

200 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements