Computer Science, asked by Shaan2242, 1 year ago

write a Java program to find the hypotenuse of a right angled triangle

Answers

Answered by Moo1
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
Similar questions