318,616 views
11 votes
11 votes
Write a C++ program to read the base , height and values, calculate and print the area of triangle

User Ralitsa
by
2.6k points

1 Answer

17 votes
17 votes

Answer:

#include <iostream>

using namespace std;

int main() {

int h, b; float A;

cout<<"Enter height and base : ";

cin>>h>>b;

A= (0.5)*h*b;

cout<<"Area of triangle is : "<<A;

return 0;

}

User Stewart Robinson
by
2.8k points