write a program in java to calculate and display the hypotenuse of a right angled triangle by talking base and perpendicular as input. [h=√(b²+ p²)]
Answers
Answered by
1
Explanation:
public static void main(String[] args)
{
double adjacent=4, opposite=3, hypotenuse;
hypotenuse= Math.sqrt((adjacent*adjacent)+(opposite*opposite));
System.out.println("The length of the hypotenuse is: " + hypotenuse);
}
}
Similar questions