Skip to content
Advertisement

JAVA program that checks if a triangle is scalene, isosceles, equilateral, or not a triangle

I am trying to write java program to see if a triangle is scalene, isosceles, equilateral or not a triangle. With the integers I used it is supposed to be not a triangle (1, 1, 30). But I keep getting scalene and not a triangle together. Any help is appreciated! Thank you!

JavaScript

Advertisement

Answer

You should check for not a triangle condition first. As below:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement