Computer Science, asked by manchester07, 1 year ago

C++ program the area of triangle

Answers

Answered by BrainlyTech
0

Hello there

Here what I know and I hope it helps you!

#include <iostream>

using namespace std;

 

int main() {

   int height, base;

   float ans;    //ans may come in fractions

   cout<<"Enter height and base : ";

   cin>>height>>base;

   ans= (0.5)*height*base;    //area of triangle formula

 

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

return 0;

}

Hope that is what your looking for...

:)

Similar questions