- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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
Advertisements