Home > Backend Development > C++ > body text

In a C program, translate the following into Chinese: What is the area of ​​the inscribed circle of a right triangle?

WBOY
Release: 2023-09-07 19:17:01
forward
805 people have browsed it

In a C program, translate the following into Chinese: What is the area of ​​the inscribed circle of a right triangle?

In order to find the area of ​​the inner circle of a right triangle, we have the formula for finding the radius of a right triangle, r = ( P B – H ) / 2.

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

The area of ​​a circle is given by:

Area = π*r2

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

Therefore the area of ​​the inner circle will be given by the following formula,

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

In a C program, translate the following into Chinese: What is the area of ​​the inscribed circle of a right triangle?

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;
}
Copy after login

Output

Area = 3.141593
Copy after login

The above is the detailed content of In a C program, translate the following into Chinese: What is the area of ​​the inscribed circle of a right triangle?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!