answersLogoWhite

0


Best Answer

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.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

7y ago

To find the area of a triangle you first need to know the base and height:

double area_of_triangle (double base, double height) {

return base * height / 2;

}

If we don't know the height, then we need to know the length of any two sides and the included angle. Using standard notation where the sides are labelled a, b and c and their opposing angles as A, B and C, given sides a, b and angle C where a is the base, the height is calculated as b * sin (C):

#include<math.h> // sin() function

double area_of_triangle2 (double a, double b, double C) {

return a * b * sin (C) / 2;

}

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write a program to find the area of a triangle?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you write a qbasic program to find area and circumerence of a circle?

Write a program that calculates the area of a triangle in QBASIC


C program to find area of a triangle?

find the area of abc a[2,3] c[6,0]


Write a c program to find Volume and surface area of cube?

Write a c program to compute the surface area and volume of a cube


Write a menu driven program in java to find area of different shapes. 1. Circle 2. Triangle 3. Rectangle?

Remember that the area of a rectangle is width * height: static int getArea(Rectangle r) { return r.width * r.height; }


How you find the area of a triangle?

To find the area of a triangle, you have to multiply the base of the triangle and the height of the triangle, then divide the product of those numbers by two.


How do you find the area and perimiter of a triangle?

To find the area of a triangle find the base and the height of the triangle. Then multiply the base by the height, then divide by 2. To find the perimiter of a triangle add together the outside edge of the triangle. To find the area of a triangle find the base and the height of the triangle. Then multiply the base by the height, then divide by 2. To find the perimiter of a triangle add together the outside edge of the triangle.


Do you have to miltiply to find the area of a triangle?

In order to find the area of a triangle, you need to multiply the base of the triangle with the height of the triangle and then halve your final answer.The formula is (Base x Height) / 2Using that, the area of a triangle can be found.Hope that helps.Jamz159


How do you find th area of triangle?

Area of a triangle = 0.5*base*perpendicular height


How do you find the perimeter of a right angled triangle using the area?

how to find the perimeter of a right angled triangle using the area


What are the rules used to find the area of a triangle?

To find the area of a triangle you - Half the base then times it by the height ! Alisha xx


Find the area of the triangle 4inch tall 3.2 base?

Find the area of the triangle 4inch tall 3.2 base


How do you find the area of a triangle given the area of the other triangle?

A= 1/2(b)(h)