0
How to find area of triangle in turbo c?
3 ответов
+ 3
you may also do this:
#include<stdio.h>
#include<math.h>
int main(){
float b,h;
float area;
printf("Enter base and height of triangle");
scanf("%f%f",&b,&h,);
area = (b*h)/2;
printf("Area of triangle is: %.3f",area);
return 0;
}
0
Why do we right 3f?
0
@Raj,
we use %.3f so that the answer will be presented with 3 decimal places.
for exampe:
The computed area is 2.3.
The answer will be presented as 2.300