Computer Science, asked by keerthanasree2008, 2 months ago

write a java program to calculate and display the area of a square and rectangle​

Answers

Answered by swarajhegde14
1

Answer:

public class RectangleSquare

{

public static void main(String args[])

{

int width=5;

int height=10;

double side = 4.5;

int arearec = width*height;

double area = side*side;

System.out.println("Area of rectangle="+arearec);

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

}

}

Similar questions