Write a java program to enter the area and breadth of rectangle and calculate its length and perimeter
Answers
Answered by
4
import java.util.*;
public class Length_Perimeter
{
public static void main(String args[])
{
Scanner in =new Scanner(System.in);
float a,l,b,p;
System.out.println("Enter the area and breadth");
a=in.nextFloat();
b=in.nextFloat();
l=a/b;
p=2*(l+b);
System.out.println("The length is"+l);
System.out.println("The perimeter is"+p);
}
}
Similar questions
Social Sciences,
5 months ago
History,
5 months ago
Political Science,
5 months ago
Chemistry,
10 months ago
English,
10 months ago
Math,
1 year ago
English,
1 year ago