Thursday, 18 August 2016
Area of triangle
#include < stdio.h >
void main()
{
int height, base;
float ans;/*ans may come in fractions*/
printf("Enter height and base");
scanf("%d %d",&height, &base);
ans= (1/2)*height*base;
/* mathematical formula*/
printf("Area if triangle is %f",ans);
}
Subscribe to:
Post Comments
(Atom)
0 comments:
Post a Comment