Computer Science, asked by visheshp69, 7 months ago

WRITE A JAVA PROGRAM TO FIND THE AREA AND PERIMETER OF RECTANGLE.

FOR CLASS 8TH❤​

Answers

Answered by Imblank
3

Answer:

Ehm... You are so lucky class 8 me hi Java seekha rahe hai mere school me to 10th ko WordPress sikhate hai By the way here's your answer

scanner sc = new scanner(System.in);

int l,b,area,perimeter;

System.out.println("Enter Length:");

sc.nextInt;

System.out.println("Enter Breadth:");

sc.nextInt;

area = l*b;

perimeter = 2*(l+b);

System.out.println("Perimeter ="+perimeter);

System.out.println("Area ="+area);

Read my bio once

Answered by anindyaadhikari13
3

Question:-

Write a java program to find the area and perimeter of a rectangle.

Program:-

import java.util.*;

class Rectangle

{

public static void main(String args[])

{

Scanner sc=new Scanner(System.in);

System.out.print("Enter the length of the rectangle: ");

double l=sc.nextDouble();

System.out.print("Enter the breadth of the rectangle: ");

double b=sc.nextDouble();

System.out.println("Perimeter is: "+(2*(l+b)));

System.out.println("Area is: "+l*b);

}

}

Similar questions