ramontricolor12

LISTA 02 - exercício 42

May 27th, 2013
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.58 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     float a, b, c;
  6.  
  7.     printf("\nInforme os 3 lados de um triangulo: ");
  8.     scanf("%f %f %f", &a, &b, &c);
  9.     if((a + b) <= c || (a + c) <= b || (b + c) <= a)
  10.     {
  11.          printf("\n Os 3 lados nao formam um triangulo, tente novamente.\n");
  12.          return -1;
  13.     }
  14.     else
  15.     {
  16.         if(a == b && b == c)
  17.             printf("\nTriangulo equilatero.\n");
  18.         else if(a == b || b == c || a == c)
  19.             printf("\nTriangulo isosceles\n");
  20.         else
  21.             printf("\nTriangulo escaleno\n");
  22.     }
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment