To find the area and perimeter of a triangle in a C program, you would first need to input the three sides of the triangle. Then, you can calculate the perimeter by adding the three sides together. Next, you can calculate the semi-perimeter by dividing the perimeter by 2. Finally, you can use Heron's formula to calculate the area of the triangle using the semi-perimeter and the three sides. The C program would involve taking user input, performing the necessary calculations, and outputting the results.
A triangle with side a: 40, side b: 25, and side c: 25cm has an area of 300cm2
area = base * height / 2;
The basic formula is: A = 1/2bh where A is area, b is the base of the triangle and h is the height Using trigonometry, the area of a triangle can also be expressed as: A = 1/2absinC, where A is the area, a and b are two sides of the triangle, and C is the angle between those sides.
x
#include<stdio.h> #include<math.h> main() { float A,a,b,c,s; printf("entr the value of a,b and c"); scanf("%f %f %f",&a,&b,&c); A=sqrt(s*s-a*s-b*s-c) printf("area of the triangle %f\n"A); getch(); }
To find the area and perimeter of a triangle in a C program, you would first need to input the three sides of the triangle. Then, you can calculate the perimeter by adding the three sides together. Next, you can calculate the semi-perimeter by dividing the perimeter by 2. Finally, you can use Heron's formula to calculate the area of the triangle using the semi-perimeter and the three sides. The C program would involve taking user input, performing the necessary calculations, and outputting the results.
Write a c program to compute the surface area and volume of a cube
For finding the area of triangle with the help of Heron's formula: [s(s-a)(s-b)(s-c)]1/2 where a,b,c are sides of the triangle and s=1/2 of perimeter of the triangle
If you know the lengths of two sides, a and b, and the included angle, C, then area = 0.5*a*b*sin(C)
Area = 1/2*a*b*SineC where a and b are the lengths and C is the angle between them. The above formula holds true for any triangle.
Area:A=1/2bhA=Area b=Base h=HeightPerimeter:P=a+b+cP=Perimeter a,b,c=side lengths of the triangle
The area of a triangle is one half base times height, so you would write a program to input the base and height, giving the option to stop, calculating and printing the area, and then looping to repeat as desired.
Heron, or sometimes called as Hero, invented the formula. The formula was used to find the area of a scalene triangle or an SSS triangle. The formula states for a triangle with sides a, b and c, the area can be calculated like this,K=sqrt(s(s-a)(s-b)(s-c)), where K is the area and s is the semiperimeter of a triangle i.e. s=(a+b+c)/2.
The area is 99.0 square units.
Do you mean an equilateral triangle? Then if so then the formula for the area of any triangle: 0.5*a*b*sinC whereas a and b are the embraced sides of angle C And in the case of an equilateral triangle it is: 0.5*any side squared*sin(60 degrees) Alternatively use Pythagoras' theorem to find the altitude of the triangle then use: 0.5*base*height = area
If you want to use object oriented approach, create a class with the details of triangles as it's data members and area function as member or friend function. formula: 1. area= height*base/2 2. area= square-root(s*(s-a)*(s-b)*(s-c)) where 2s=a+b+c