Thursday, 2 January 2014

Area Of Tripezium

A program that tells area of tripezium


#include<stdio.h>
int main()
{
float height,base1,base2;
float area;
printf("Enter the height of the trapezium: ");
scanf("%f",&height);
printf("Enter length of lower base of the trapezium: ");
scanf("%f",&base1);
printf("Enter length of upper base of the trapezium: ");
scanf("%f",&base2);
area = 0.5 * (base1 + base2) * height;            /*a=(b1+b2)xh/2*/
printf("\nArea of trapezium is: %f",area);
return 0;

}

No comments:

Post a Comment