mabele

Members
  • Content Count

    2
  • Joined

  • Last visited

  1. Please let me know if this is correct programme. How to execute this programme.
  2. #include<iostream> #include<math.h> using namespace std; int main(){ //variables float aside, bside, cside; //enter side a cout << "enter the length of side a " << endl; cin >> aside; //enter side b cout << "enter the length of side b " << endl; cin >> bside; //enter side c cout << "enter the length of side c " << endl; cin >> cside; if (aside == bside && bside == cside) // all sides equal cout << "Equilateral triangle\n"; else if (aside == bside || aside == cside || bside == cside) // at least 2 sides equal cout << "Isosceles triangle\n"; else // no sides equal cout << "Scalene triangle\n"; float first, second, third; float s, area; cout << endl << "Enter size of each sides of triangle" << endl; cout << "Enter size for First Side ="; cin >> first; cout << "Enter size for Second Side ="; cin >> second; cout << "Enter size for Third Side ="; cin >> third; s = (first + second + third) / 2; area = sqrt(s*(s - first)*(s - second)*(s - third)); cout << "Area of Triangle= " << area << endl; system("pause"); return 0; }