answersLogoWhite

0


Best Answer

import java.util.*;

public class triangle {

public static Scanner vic= new Scanner(System.in);

public static void main(String[]args){

System.out.println("Enter measurement of adjacent: ");

int adj = vic.nextInt();

System.out.println("Enter measurement of opposite: ");

int opp = vic.nextInt();

System.out.println("Enter measurement of hypoteneuse: ");

int hyp = vic.nextInt();

if(( adj < opp )&&(opp<hyp)){

System.out.println("Right triangle");

System.out.println("Regular triangle");

}

else if (( adj<opp )&&( opp > hyp)){

System.out.println("Isosceles triangle");

}

else if (( adj == opp)&&(adj==hyp)&&(hyp==opp)){

System.out.println("Equilateral triangle");

}

else{

System.out.println("Not a triangle");

}}

}

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a Java program to determine whether the triangle is equilateral triangle?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How many sides does an equilateral triangle have?

All triangles have exactly three sides. This is true whether the triangle is equilateral or not. If the triangle is equilateral, then the three sides will all be equal in length.All triangles have three sides.


How many diagonals dose a equilateral triangle?

None. Triangles - whether equilateral or not - do not have diagonals


Why can't you fit an equilateral triangle in a square?

We have no problem fitting an equilateral triangle into a square. It depends on the size of the triangle and the size of the square whether one can be fit inside the other.


Is a triangle equiangular?

It depends on what type of triangle it is.If it is equilateral then it will also be equiangular.If it is isosceles then it may be equiangular (it depends whether it is equilateral or not - an isosceles can be equilateral or it can just have two equal sides).Any other type of triangle will not be equiangular.


How many angle does an equilateral triangle have?

All triangles, whether equilateral or otherwise, have three angles.


How do you find which triangle if you know the lengths of the sides of a triangle whether it is isosceles or equilateral or scalene?

You look at the lengths of the sided of the triangle. If the two lengths are same, the triangle is an isosceles triangle. If all the lengths are same, the triangle is an equilateral triangle. If none of the lengths are same, the triangle is a scalene triangle.


How can you start the program 'read in the lengths of the sides of a triangle and determine whether the triangle is an isosceles triangle two sides are equal an equilateral triangle three sides are'?

This would depend on what programming language you wanted to write it in. For example, in Pascal, the code might look like this: Program Isosceles; Var A, B, C : Real; Begin WriteLn('Input side A.'); ReadLn(A); WriteLn('Input side B.'); ReadLn(B); WriteLn('Input side C.'); ReadLn(C); If A = B Then Begin If B = C Then Begin WriteLn('This triangle is equilateral.'); End Else Begin WriteLn('This triangle is isosceles.'); And so on.


How can you tell whether a triangle has reflecton symmetry?

If its an isosceles triangle it has 1 line of symmetry but if its an equilateral triangle it has 3 lines of symmetry


How many angles in an equilateral triangle?

Are you kidding me?! you are asking, how many angles are there in a three-sided polygon? Obviously three!! and since it is an equilateral all the angles would be same- 60 + 60 + 60 = 180 ( angle sum property of triangle)


What is the sum of dergrees in a triangle?

the sum of the internal angles of a triangle, no matter whether isosceles, equilateral or scalene, is always 180 degrees


How many vertices in a scalene triangle?

3 vertices in a triangle, whether it is equilateral, isosceles or scalene; acute angled, right or obtuse.


A equilatural triangle has how many sides?

All triangles have three sides. Whether or not it is equilateral is irrelevant.