Write a Java Program to accept the length and breadth of a rectangle and find its perimeter
Answers
Answer: package com.tcc.java.programs;
import java.util.*;
public class RectangleAreaPerimeter {
public static void main(String args[]) {
int length, width, area, perimeter;
Scanner in = new Scanner(System.in);
System.out.println("Enter length of Rectangle");
length = in.nextInt();
System.out.println("Enter width of Rectangle");
width = in.nextInt();
// Area of rectangle = length X width
area = length*width;
// Perimeter of rectangle = 2 X (length X width)
perimeter = 2*(length + width);
System.out.println("Area of Rectangle : "+ area);
System.out.println("Rectangle of Rectangle : "+ perimeter);
}
}
I hope it helps you mate :D
Please mark as the brainliest answer because its just a click for you but a world for me