Wednesday 27 August 2014

Area of Trapezoid solution in c plusplus

Leave a Comment

//Area of Trapezoid height × (base1 + base2) / 2
#include<iostream>
#include<conio.h>
#include<math.h>
using namespace std;
static double pi=3.1415926535;
int main()
{
double base1,base2,height,temp,Ans;
cout<<"Enter Base 1 = ";
cin>>base1;
cout<<"Enter Base 2 = ";
cin>>base2;
cout<<"Enter Height  = ";
cin>>height;
temp=height*(base1+base2);
Ans=temp/2;
cout<<"Area of Trapezoid = "<<Ans;
getch();
}
If You Enjoyed This, Take 5 Seconds To Share It

0 Questions: