To Check the Given Triangle is Isocles , Equilateral or Right Angled Triang
By
Shine Aiyyappan on
Jun 30th, 2012 9:12 am To Check the Given Triangle is Isocles , Equilateral or Right Angled Triang
Because of the way that pow and sqrt are written internally, it is usually much more efficient to multiply doubles rather than using these functions for squaring operations.
{
Sum_of_sq1 = Side1*Side1 + Side2*Side2;
Sum_of_sq2 = Side1*Side1 + Side3*Side3;
Sum_of_sq3 = Side2*Side2 + Side3*Side3;
if (Sum_of_sq1==Side3*Side3 || Sum_of_sq2==Side2*Side2 || Sum_of_sq3==Side1*Side1)
printf("The triangle is a right triangle.\n");
}
Nutster
Junior Poster
129 posts since Oct 2006
Reputation Points: 62
Solved Threads: 19
Skill Endorsements: 3
© 2013 DaniWeb® LLC
Page generated in 0.0546 seconds
using 2.63MB