Shine Aiyyappan

*(ashine80)*
Reputation Points: 0 [?]

Q&As Helped to Solve: 0 [?]

Skill Endorsements: 0 [?]

1.11M Members

Shine Aiyyappan *(ashine80)*

Reputation Points: 0 [?]

Q&As Helped to Solve: 0 [?]

Skill Endorsements: 0 [?]

```
#include<stdio.h>
#include<ctype.h>
#include<conio.h>
#include<math.h>
int main()
{
float Side1,Side2,Side3;
float Flag1,Flag2,Sum_of_sq1,Sum_of_sq2,Sum_of_sq3;
clrscr();
printf("Enter Three Sides Side1 Side2 Side3 :");
scanf("%f %f %f", &Side1 , &Side2 , &Side3);
Flag1=(Side1==Side2)?(Side2==Side3?1:0):((Side2==Side3)?0:-1);
if(Flag1==0)
{ printf("Triangle is Isoceles\n");
}
if (Flag1==1)
{ printf("Equilateral Triangle");
}
Sum_of_sq1=pow(Side1,2)+pow(Side2,2);
Sum_of_sq2=pow(Side1,2)+pow(Side3,2);
Sum_of_sq3=pow(Side2,2)+pow(Side3,2);
if (sqrt(Sum_of_sq1)==Side3 ||sqrt(Sum_of_sq2)==Side2 || sqrt(Sum_of_sq3)==Side1)
printf("The Triangle is Right Angled Triangle");
getch();
return(0);
}
```

0

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");
}
```

You

Tags Related to this Article