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
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
Business Studies,
4 months ago
Sociology,
4 months ago
Physics,
8 months ago
Economy,
11 months ago
Biology,
11 months ago