C program to find out area of trapezium

1. C program or source code for find area of trapezium
2. How to calculate area of trapezium in c programming language

int main(){
    float height,base1,base2;
    float area;
    printf("Enter the height of the trapezium: ");
    printf("Enter length of lower base of the trapezium: ");
    printf("Enter length of upper base of the trapezium: ");
    area = 0.5 * (base1 + base2) * height;
    printf("Area of trapezium is: %f",area);
    return 0;

No comments: