Computer Science, asked by geetoinam8328, 10 months ago

Write a program to enter 3 sides of a triangle and check whether it is isosceles, scalene or equilateral triangle by using scanner class.

Answers

Answered by alenealvares
1

Answer:

import java.util.*;

class tri

{

         public static void main()

       {

              Scanner s = new Scanner(System.in);

              System.out.println("Enter three sides of triangle");

              int a = s.nextInt();

              int b = s.nextInt();

              int c = s.nextInt();

              triangle_type(a,b,c);

                                            }

              static void triangle_type(int x,int y,int z)

             {

                   if(x==y&&y==z)

                   System.out.println("Triangle is equilateral");

                   else if(x==y||y==z||z==x)

                   System.out.println("Triangle in isosceles");

                   else

                   System.out.println("Triangle is scalene");

                                              }

}

Read more on Brainly.in - https://brainly.in/question/3734238#readmore

Explanation:

Similar questions