Math, asked by adityakrishnakk, 2 months ago

write a program in java to find hypotenuse of right angle triangle by taking perpendicular and base as input h=√p×p+b*b​

Answers

Answered by simrankerketta007
3

Answer:

✨HEYA MATE!!✨

import java.util.Scanner;

public class KboatHypotenuse

{

public static void main(String args[]) {

Scanner in = new Scanner(System.in);

System.out.print("Enter Perpendicular: ");

double p = in.nextDouble();

System.out.print("Enter Base: ");

double b = in.nextDouble();

double h = Math.sqrt(Math.pow(p, 2) + Math.pow(b, 2));

System.out.println("Hypotenuse = " + h);

}

}

Attachments:
Similar questions