write a Java program to find the hypotenuse of a right angled triangle
Answers
Answered by
1
public class Triangle {
public static void main(double ab,double bc, double ca){
if(a+b+c == 180){
if (a==90||b==90||c==90){
if ( (ab)*(ab) +(bc)*(bc)== (ca)*(ca))
System.out.println("Hypotenuse= "+ ac);
else if((bc*bc) +(ca*ca)== (ab*ab))
System.out.println("Hypotenuse= "+ab);
else if((ca*ca)+(ab*ab)==(bc*bc))
System.out.println("Hypotenuse="+bc);
}
else
System.out.println(" Not a Right angled triangle");
}
else
System.out.println("Triangle Not Possible");
}
}
####HOPE THIS HELPS
####MARK AS BRAINLIEST PLEASE
public static void main(double ab,double bc, double ca){
if(a+b+c == 180){
if (a==90||b==90||c==90){
if ( (ab)*(ab) +(bc)*(bc)== (ca)*(ca))
System.out.println("Hypotenuse= "+ ac);
else if((bc*bc) +(ca*ca)== (ab*ab))
System.out.println("Hypotenuse= "+ab);
else if((ca*ca)+(ab*ab)==(bc*bc))
System.out.println("Hypotenuse="+bc);
}
else
System.out.println(" Not a Right angled triangle");
}
else
System.out.println("Triangle Not Possible");
}
}
####HOPE THIS HELPS
####MARK AS BRAINLIEST PLEASE
Similar questions
Science,
7 months ago
Social Sciences,
7 months ago
Math,
7 months ago
Science,
1 year ago
Accountancy,
1 year ago