+ Reply to Thread
Results 1 to 2 of 2

Thread: C++ program

  1. #1
    PerrySullivan is offline Senior Member
    Join Date
    Dec 2009
    Posts
    209
    Rep Power
    3

    Default C++ program

    C++ program for Area of a Trapezoid

    I am learning C++. I have written a program for calculating the Area of a trapezoid. The program is not compiling because it is giving an error in the #include <iostream> line. I do not know when does this error create? Any help?

  2. #2
    RussellBarnes is offline Senior Member
    Join Date
    Dec 2009
    Posts
    214
    Rep Power
    3

    Default

    Try the given code which is resolve your problem.

    #include <iostream>
    using namespace std;
    int main()
    {
    int parallelsidea;
    int parallelsideb;
    int height;
    int Area;
    cout << "Enter the length of the first parallel side: ";
    cin >> parallelsidea;
    cout << endl << "Enter the length of the second parallel side: ";
    cin >> parallelsideb;
    cout << endl << "Enter the height: ";
    cin >> height;
    Area = (parallelsidea + parallelsideb) / 2 * height;
    cout << endl << "Area of the Trapezoid: " << Area << endl;
    system("pause");
    return 0;
    }

+ Reply to Thread

Similar Threads

  1. Need the Best Program
    By Davisricky in forum Programming
    Replies: 1
    Last Post: 02-23-2010, 01:07 PM
  2. What to Look for in a CRM Program
    By niks54 in forum Software Jargons
    Replies: 0
    Last Post: 12-14-2009, 05:57 PM
  3. Invitation to url via a program in C++
    By Aaron Ruell in forum Programming
    Replies: 4
    Last Post: 10-27-2009, 10:25 AM
  4. Help for a Program
    By Gabriel Carlos in forum Programming
    Replies: 2
    Last Post: 10-22-2009, 11:38 AM
  5. Using several web communities in one program
    By Easton Fletcher in forum General Internet Terms
    Replies: 1
    Last Post: 07-14-2009, 07:21 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48