answersLogoWhite

0

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

12y ago

Still curious? Ask our experts.

Chat with our AI personalities

BeauBeau
You're doing better than you think!
Chat with Beau
SteveSteve
Knowledge is a journey, you know? We'll get there.
Chat with Steve
EzraEzra
Faith is not about having all the answers, but learning to ask the right questions.
Chat with Ezra

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