+ 1

Pleasee Ive been confused with this for ages

So I'm trying to make it if the input is 100,400,200 the output is Isoceles triangle and if it's 100,200,500 The output is not a triangle, I've been trying to figure this out for ages and I think I'm to stupid to do so /* Program for a triangle */ #include <stdio.h> int main() { int a, b, c; scanf("%d %d %d", &a, &b, &c); if ((a >= b + c) || (b >= a + c) || (c <= a + b)) printf("Bukan Segitiga"); else if ((a == b) && (b == c)) printf("Equilateral triangle"); else if ((a == b) || (b == c) || (a == c)) printf("Isoceles Triangle"); else printf("Scalene Triangle"); return 0; } It's c++ by the way.. Basically to put more context The question is Input 5 5 5 = Equilateral triangle 1000 1000 500 = Isoceles triangle 100 200 500 = not a triangle 100 400 200 = Scalne triangle But the catch is, when you input 100 400 200, the output is not a triangle. How can I fix this??? That "bukan segitiga" just means not a triangle in my country btw I forgot to change it Please if someone can help me on this you'll save my life

13th Apr 2025, 2:07 PM
GoldieMelodie
GoldieMelodie - avatar
3 Answers
+ 7
This appears to be a c language program not cpp https://sololearn.com/compiler-playground/cs1A2zC0e099/?ref=app
13th Apr 2025, 6:22 PM
BroFar
BroFar - avatar
+ 6
100 + 200 = is not greater than 400 thus not a scalene triangle 3 7 5 3 + 5 is greater than 7 is scalene triangle
13th Apr 2025, 7:18 PM
BroFar
BroFar - avatar
0
My issue here is with the scalene triangle one How could I make it so the input "100,400,200" would have the output of scalene triangle?
13th Apr 2025, 3:19 PM
GoldieMelodie
GoldieMelodie - avatar