Write a function to find the area of a triangle whose length of three sides is given
#include<stdio.h>
#include<conio.h>
float
triangle (float b, float h)
{
float
result;
result=(b*h)/2;
return(result);
}
void
main()
{
clrscr();
float
a,b,ans;
printf(“Enter
the Base of Triangle: “);
scanf(“%f”,&a);
printf(“Enter
the Height of Triangle: “);
scanf(“%f”,&b);
ans=triangle(a,b);
printf(“Area
of Triangle is %f”,ans);
getch();
}
No comments:
Post a Comment