Triangle Area

Triangle Area

Given the height and base length of a triangle, return the area.

triangleArea( 2.0, 2.0 ) => 2.0
triangleArea( 3.0, 4.0 ) => 6.0
triangleArea( 3.0, 5.0 ) => 7.5

Formula

\(\Large area = \frac{base \times height}{2}\)

Login / Register

To try your hand at solving this problem you'll need an account on CompSci.Rocks. Please either login or register to continue.

Once you've logged in you'll be able to enter code directly into this page to solve the problem.

[ultimatemember form_id=401]
CompSci.rocks Newsletter

Want to stay in touch and keep up to date with the latest posts @ CompSci.rocks?

Leave a Reply

Your email address will not be published. Required fields are marked *