Sandhya Oops - CPP
Sandhya Oops - CPP
Triangle triangle;
double base, height, side1, side2;
cout << "Enter base and height of the right-angle
triangle: ";
cin >> base >> height; cout << "Area of the right-
angle triangle: " << triangle.area(base, height) <<
endl;
cout << "Enter the side of the equilateral triangle: ";
cin >> side1; cout << "Area of the equilateral
triangle: " << triangle.area(side1) << endl;
cout << "Enter the base and two equal sides of the
isosceles triangle: ";
cin >> base >> side1 >> side2; cout << "Area of the
isosceles triangle: " <<
triangle.area(base, side1, side2) << endl;
return 0;
}
Sandhya BCA(B)2323380
Output: -
Enter base and height of the right-angle triangle:
56,66
Area of the right-angle triangle: 1848
Enter the side of the equilateral triangle: 45
Area of the equilateral triangle: 876.851
Enter the base and two equal sides of the
isosceles triangle: 56
77
90
Area of the isosceles triangle: 2142.46