Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

formula to find the area of a trapezium in c

/* 
     formula is : (base1 + base2) / 2 * height
 */
#include <stdio.h>
int main()
{
     double base1, base2, height, area;
     scanf("%lf %lf %lf", &base1, &base2, &height);

     area = (base1 + base2) / 2 * height; // applying formula
     printf("Area: %0.3lf
", area);
     return 0;
}
 
PREVIOUS NEXT
Tagged: #formula #find #area #trapezium
ADD COMMENT
Topic
Name
5+7 =