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");
}}
}
Chat with our AI personalities
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.
The answer will depend on whether the length is the hypotenuse or one of the legs of the triangle.
sin, tan and cos can be defined as functions of an angle. But they are not functions of a triangle - whether it is a right angled triangle or not.
A regular polygon is a polygon which is equiangular (all angles are the same) and equilateral (all sides have the same length).
imaginary