Saturday 16 July 2011

Write a c program to find the area of a trapezium




C
program for area of a trapezium








Formula of
area of trapezium:



Area = (1/2) * (a + b) * h



C code:



#include



int main(){



    float b1,b2,h;

    float area;



    printf("Enter the size of two bases and height of the trapezium : ");

    scanf("%f%f%f",&b1,&b2,&h);



    area
= 0.5 * ( b1 + b2 ) * h ;



    printf("Area of trapezium
is: %.3f",area);



   

No comments:

Post a Comment