Ask a Teacher



HOW TO WRITE A TURBOC++ APPLICATION TO FIND THE AREA OF A TRAPEZIUM?

#include<iostream.h>
#include<conio.h>
void main()
{
    float base1;
    float base2;
    float height;
    float area;
    cout<<"Enter the value for first base of a trapezium";
    cin>>base1;
    cout<<"Enter the value for second base of a trapezium";
    cin>>base2;
    cout<<"Enter the value for height of a trapezium";
    cin>>height;
    area=0.5*(base1+base2)*height;
    cout<<"Area of a trapezium is:";
    cout<<area;
    getch();
}



comments powered by Disqus