write a program in java yo find the area perimeter of a rectangle according to the choice taking length and breadth as input
Answers
Answer:
java is the program for the computer so we first look steps ok
Explanation:
(1) rectangle needs length supppose length is 56m
breadth is 26m
(2) we tale it (input) ok (56m) (26m) ok
(3) perimeter of rectangle is 2 (l+b)
(4) ok then take values 2(56+26) = 82÷2 = 41 m
(5) so the right answer is 41 m ok
this is an example you cna solve this question by your numbers.
Answer:
import java.io.*;
public class Rectangle
{
public static void main(String args[ ])throws IOException
{
InputStreamReader read=new InputStreamReader(System.in);
BufferedReader in=new BufferedReader(read);
int l,b,A=0;
System.out.println("Enter the length and breath of the rectangle");
l=Integer.parseInt(in.readLine());
b=Integer.parseInt(in.readLine());
A=l×b;
System.out.println("The area of rectangle="+A);
}
}