write a program in Java to find
and display the diognal and the
area of a rectangle by taking its
length and width as inputs.
Sample Input : length = 10cm
width = 5cm
(diognal)
e ² = (length) + (width
Answers
Answered by
0
Answer:
import java.util.*;
class Area
{
static void main()
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter length and width of rectangle");
int l = sc.nextInt();
int w = sc.nextInt();
System.out.println("Diagonal: " + Math.sqrt((l * l) + (h * h)));
System.out.println("Area: " + (l * w));
}
}
Hope this helps u!! Pls mark as brainliest!
Similar questions