Program to find the Area of an Ellipse in C++

C++Server Side ProgrammingProgramming

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
raja
Published on 02-Jun-2020 11:22:29
Advertisements