0
The program aims to identify whether a triangle is equilateral, isosceles, or scalene. But there is an error in the isosceles identification line, where if the user puts equal input values on the first two sides and different on the last, he is not recognized.
Example:
- measure of lado1:
3
; - measure of lado2:
4
; - measure of lado3:
2
;
Code:
#include<stdio.h>
int main(){
int L1,L2,L3;
int equilatero,isoceles,escaleno;
printf("media do lado1:");
scanf("%d",&L1);
printf("media do lado2:");
scanf("%d",&L2);
printf("media do lado3:");
scanf("%d",&L3);
equilatero = (L1 == L2)&&(L1 == L3);
printf("seu triangulo eh equilatero: %d\n",equilatero);
isoceles = ((L1==L2)||(L1==L3)||(L2==L3))&&((L1!=L2)||(L2=!L3)||(L1=!L3));
printf("seu triangulo eh isoceles: %d \n",isoceles);
escaleno = (L1 != L2)&&(L2 != L3)&&(L1 != L3);
printf("seu triangulo eh escaleno: %d \n",escaleno);
return 0;
}
See if it helps you: http://answall.com/q/56916/101
– Maniero