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
MaxineMaxine
I respect you enough to keep it real.
Chat with Maxine
ReneRene
Change my mind. I dare you.
Chat with Rene

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