![]() |
A Trapezium or (Trapezoid) is a convex quadrilateral with at least one pair of parallel sides. The parallel sides are called the bases of the trapezoid and the other two sides which are not parallel are referred to as the legs. There can also be two pairs of bases. The area of a trapezium can be found by using this simple formula : Area = (a+b)/2*h Example: Input : base1 = 15, base2 = 30, height = 10 Approach:
Example: Below is the function to find area of trapezium. Javascript
Output
Area is: 54 Time complexity: O(1) Auxilitary Space complexity: O(1) |
Reffered: https://www.geeksforgeeks.org
JavaScript |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 12 |