Computer Science, asked by dblc6128, 10 months ago

Write a pragram to accept the length and breadth of a rectangle and calculate the area and petimeter

Answers

Answered by riddhidebbasu
1

Answer:

I AM DOING THIS IN JAVA

Explanation:

import java.util.*;

public class area_perimeter

{

public static void main (String args[ ])

{

Scanner sc = new Scanner (System.in);

System.out.println("Enter the length and

breadth of the rectangle");

double l = sc.nextDouble();

double b = sc.nextDouble();

double area = 0.0 , perimeter =0.0 ,

perimeter = 2.0 * ( l + b );

area = l*b;

System.out.println(" Area is : " + area);

System.out.println( " Perimeter

is:"+perimeter);

}

}

Similar questions