# C Program to Find Area of Ellipse

In this post, we will learn how to find the area of an ellipse using C Programming language.

The area of an ellipse is defined as the amount of region present inside it.Â

• Area of Ellipse = Ï€ a b,

where,
a = length of semi-major axis
b = length of semi-minor axis

So, without further ado, letâ€™s begin this tutorial.Â

Contents

## C Program to Find Area of Ellipse

// C Program to Find Area of Ellipse
#include <stdio.h>
#define PI 3.14
int main(){
float major, minor, area;

printf("Enter the minor axis: ");
scanf("%f", &minor);
printf("Enter the major axis: ");
scanf("%f", &major);

// Calculating area of ellipse
area = PI * minor * major;

// Displaying output
printf("Area of Ellipse: %.2f", area);
return 0;
}

Output

Enter the minor axis: 7
Enter the major axis: 15
Area of Ellipse: 329.70

## How Does This Program Work ?

float major, minor, area;

In this program, we have declared three float data type variables named major, minor and area.

printf("Enter the minor axis: ");
scanf("%f", &minor);
printf("Enter the major axis: ");
scanf("%f", &major);

Then, the user is asked to enter the value of the major axis and minor axis.

// Calculating area of ellipse
area = PI * minor * major;

We calculate the area using the formula Ï€ a b, where,
a = length of semi-major axis
b = length of semi-minor axis
Î  – 3.14

// Displaying output
printf("Area of Ellipse: %.2f", area);

Finally, the area is printed using the printf() function. Here, we have used %.2f format specifier because we want to display the output only till 2 decimal places.

## Conclusion

I hope after going through this post, you understand how to find the area of an ellipse using C Programming language.

If you have any doubt regarding the program, feel free to contact us in the comment section. We will be delighted to help you.