-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path18_triangulo.c
More file actions
33 lines (32 loc) · 878 Bytes
/
18_triangulo.c
File metadata and controls
33 lines (32 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(){
float a;
float b;
float c;
printf("===== Tipo de Triângulo =====");
printf("\nInsira o tamanho do lado A: ");
scanf("%f", &a);
printf("\nInsira o tamanho do lado B: ");
scanf("%f", &b);
printf("\nInsira o tamanho do lado C: ");
scanf("%f", &c);
//é triângulo
if ((a<(b+c))&&(b<(a+c))&&(c<(a+b))){
//tipo de triângulo
if ((a == b)&&(b == c)&&(c == a)){
printf("\nO triângulo é Equilátero.");
} else if((a == b)||(b == c)||(c == a)){
printf("\nO triângulo é Isósceles.");
}
else{
printf("\nO triângulo é Escaleno");
}
}
else {
printf("ERRO! Triângulo de tamanhos inválidos.");
return 1;
}
return 0;
}