Oops, my bad. Sorry. Anyone for the area of a line?Originally posted by DrZoidberg
No. Your area calculation is correct.
If the 3 lengths are 10, 6 and 4 then the area is 0.
Thats perfectly correct.
Just try to draw that triangle and you will see why.
I just recompiled your code exactly as posted and got the following in output.txt:
Values of triangle:
Shortest side is 5
Longest side is 10
Perimeter is 23
Area is 19.81
sides.txt contains
10 5 8