#include<conio.h>
#include<iostream.h>
float areaoftriangle(float b,float h);
void main()
{
clrscr();
float x,y,z;
cout<<"Enter base of the Triangle ";
cin>>x;
cout<<"Enter height of the Triangle ";
cin>>y;
z=areaoftriangle(x,y);
cout<<"Area of the Triangle = "<<z;
getch();
}
float areaoftriangle(float b,float h)
{
float ar;
ar=0.5*b*h;
return(ar);
}
#include<iostream.h>
float areaoftriangle(float b,float h);
void main()
{
clrscr();
float x,y,z;
cout<<"Enter base of the Triangle ";
cin>>x;
cout<<"Enter height of the Triangle ";
cin>>y;
z=areaoftriangle(x,y);
cout<<"Area of the Triangle = "<<z;
getch();
}
float areaoftriangle(float b,float h)
{
float ar;
ar=0.5*b*h;
return(ar);
}
No comments:
Post a Comment