Computer Science, asked by navneetvinod1512, 7 months ago

Write a program in Java to find and display the area and perimeter of a right-angled triangle by using function argument. Take perpendicular and base as inputs from the console ​

Answers

Answered by parthwankhede21
3

Answer:

please brainlist my answer

Explanation:

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);

}

Similar questions