Write a java program to find the diagonal of a rectangle. Take length and breadth as input
Answers
Answered by
0
Answer:
we multiply both no. firsly to find java
Answered by
1
import java.util.*;
public class Diagonal
{
public static void main (String args[])
{
Scanner in = new Scanner(System.in);
int l, b;
double d;
System.out.println("enter the length and breadth of the rectangle:");
l = in.nextInt();
b = in.nextInt();
d = Math.sqrt(l*l + b*b);
System.out.println("Diagonal of the rectangle =");
}
}
Similar questions