12 lines
271 B
C++
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;
|
|
} |