- Trending Categories
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 Circumcircle of a Right Angled Triangle in C Program?
Here we will see how to get the area of circumcircle of a right angled triangle. The hypotenuse of the triangle is forming the diameter of the circle. So if the hypotenuse is h, then radius is h/2
So the area is −
Example Code
#include <iostream> #include <cmath> using namespace std; float area(float h) { if (h < 0) //if h is negative it is invalid return -1; float area = 3.1415 * (h/2) * (h/2); return area; } int main() { float h = 8; cout << "Area : " << area(h); }
Output
Area : 50.264
Advertisements