programming-examples/c++/_Basic/Area of a triangle.cpp
2019-11-15 12:59:38 +01:00

12 lines
271 B
C++

#include < iostream.h >
void main()
{
int height, base;
float ans;/*ans may come in fractions*/
cout<<"Enter height and base";
cin>>height>>base;
ans= (1/2)*height*base;
/* mathematical formula*/
cout<<"Area if triangle is"<<ans;
}