Area of Incircle of a Right Angled Triangle in C Program?


To find the area of a circle inside a right angled triangle, we have the formula to find the radius of the right angled triangle, r = ( P + B – H ) / 2.

Given the P, B and H are the perpendicular, base and hypotenuse respectively of a right angled triangle.

Area of a circle is given by the formula,

Area = π*r2

where π = 22 / 7 or 3.14 and r is the radius of the circle.

Hence the area of the incircle will be given by the formula,

Area = π* ((P + B – H) / 2)2.

Example

#include
#define PI 3.14159265
int main() {
   float area,P = 3, B = 4, H = 5;
   area=(P + B - H) * (P + B - H) * (PI / 4);
   printf("Area = %f", area);
   return 0;
}

Output

Area = 3.141593

Updated on: 09-Aug-2019

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements