write a java program to calculate and display the area of a square and rectangle
Answers
Answered by
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
Accountancy,
1 month ago
Social Sciences,
1 month ago
Computer Science,
1 month ago
Business Studies,
2 months ago
Biology,
2 months ago
Math,
9 months ago
Math,
9 months ago
Math,
9 months ago