fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. float base, height, area;
  6.  
  7. cout << "Enter base of the triangle: ";
  8. cin >> base;
  9.  
  10. cout << "Enter height of the triangle: ";
  11. cin >> height;
  12.  
  13. area = (base * height) / 2;
  14.  
  15. cout << "Area of triangle: " << area << endl;
  16.  
  17. return 0;
  18. }
Success #stdin #stdout 0s 5276KB
stdin
10
5
stdout
Enter base of the triangle: Enter height of the triangle: Area of triangle: 25