I' using the following logic for testing whether the triangle is isosceles, equilateral, scalene or right angled.
if (side1 == side2 || side2 == side3 || side1 == side3)
printf("Isosceles triangle.");
else if (side1 == side2 && side2 == side3 && side3 == side1)
printf("equilateral triangle");
I get the output for sides 3 3 3 as isosceles but not equilateral but when I interchange the logic that is write the logic of equilateral first I get equilateral. I can't understand what's happening?