Quote:
Originally posted by WaltP
Your area calculation is wrong.
using 10, 4, 6 as side lengths, perimeter is 20.
s = perimeter/2.0; make s= 10
area = s * (s-length[0]) * (s-length[1]) * (s-length[2]);
which makes (s-length[0]) = 0.
Also, you can make each of your fprintf() statements easier byt not outputting a constant string. Change them to
fprintf(output, "Area is %.2f \n", area);
And you didn't use code tags -- click on the link Dave_Sinkula gave you to answer how to use them.
Then how should I calculate area? I can't think of any formula. Please help.