Computer Science, asked by ritrishnasah, 5 months ago

Write a program to input the length and breadth of a rectangle and find its area and perimeter​

Answers

Answered by tabassumparveen5786
5

Answer:

Scanner sc = new scanner (system. In) ; float length, breath, area, perimeter;

System.out.put.in ("enter length and breath of a ractangle")

Length = sc. Nextfloat();

Breath = sc. Nextfloat () ;

Area = Length × breath ;

Perimeter = 2( length + breath) ;

System.out.printin.("area" +area) ;

System.out.printin. ("perimeter" +perimeter) ;

Explanation:

I hope it is help full for you.

Answered by CopyThat
2

Program: {JAVA}

import java.util.*;

public class Brainly

{

static void main()

{

Scanner sc=new Scanner(System.in);

float length,breadth,area,perimeter;

System.out.println("Enter length and breadth of a rectangle:");

length=sc.nextFloat();

breadth=sc.nextFloat();

area=length*breadth;

perimeter=2*(length+breadth);

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

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

}

}

Similar questions