write a java program to accept three sides of a triangle and show that if trangle is possble or not, if possible then show that it is equilateral or isosceles or scelen triangle.
Answers
Answered by
3
Answer:
See below.
Explanation:
int a = 12 // Some int number
int b = 3
int c = 4
if ( a + b > c && b + c > a && a + c > b ) {
// The triangle can be formed.
if ( a == b && b == c && a == c ) {
// Equilateral triangle
}
else if ( a == b || b == c || a == c ) {
// Isosceles triangle
}
else {
// Scalene triangle
}
}
Similar questions