Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- float a, b, c;
- printf("\nInforme os 3 lados de um triangulo: ");
- scanf("%f %f %f", &a, &b, &c);
- if((a + b) <= c || (a + c) <= b || (b + c) <= a)
- {
- printf("\n Os 3 lados nao formam um triangulo, tente novamente.\n");
- return -1;
- }
- else
- {
- if(a == b && b == c)
- printf("\nTriangulo equilatero.\n");
- else if(a == b || b == c || a == c)
- printf("\nTriangulo isosceles\n");
- else
- printf("\nTriangulo escaleno\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment