Computer Science, asked by raysoumalya, 8 months ago

CS 18. Write a program in java to
compute the area and perimeter of a
rectangle
with
length - 50cm
and breadth =15cm.

Answers

Answered by sohankundu99
1

Answer:

Explanation:

class rectangle

{

   public static void main( )

   {

        int length = 50, breadth = 15, area, perimeter;

        perimeter = 2 * (length + breadth);

        area = length * breadth;

        System.out.println("Perimeter of the rectangle: "+perimeter+" cm");

        System.out.println("Area of the rectangle: "+area+" cm^2");

   }

}

Similar questions