Computer Science, asked by Anonymous, 11 months ago

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 shubham0204
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