Computer Science, asked by shruthi94, 6 months ago

WAP to calculate and display the hypotenuse of a right-angled triangle by
taking perpendicular and base as inputs.

Answers

Answered by AnindaBasu
3

Answer:

import java.util.*;

class rightangletraingle

{

public static void main (String args[ ])

{

Scanner sc=new Scanner(System.in);

double h,b,p;

System.out.println(" Enter the Perpendicular and Base ");

b=sc.nextDouble();

p=sc.nextDouble();

h=Math.sqrt(b*b+p*p);

System.out.println("Hypotenuse:-" +h);

}

}

Similar questions