Computer Science, asked by hhhhyyrfft, 1 year ago

Write a program to enter the three sides of a triangle and find either its an equilateral or scalene or isosceles triangle.

Answers

Answered by Anonymous
14

import java.util*;

public class Triangle

{

public static void main(String args[])

{

Scanner in = new Scanner(System.in);

float a,b,c;

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

a= in.nextFloat();

b=in.nextFloat();

c=in.nextFloat();

if(a=b=c)

{

System.out.println("Its an equilateral triangle");

}

elseif(a=b||b=c||c=a)

{

System.out.println("Its an isosceles triangle");

}

else(a!=b!=c)

{

System.out.println("Its a scalene triangle");

}

}

}

Answered by Anonymous
2

Answer:

hello

the triangle is equilateral. If it is not an equilateral triangle then it may be isosceles. Check if(side1 == side2 || side1 == side3 || side2 == side3) , then triangle is isosceles..

Similar questions