write a java program program to accept two sides of a rectangle.If two sides are equal , Display it is square.Also calculate the area of the figure and display it
do it with InputStreamReader system
Answers
Answered by
1
Answer:
/**
* @author: BeginnersBook.com
* @description: Program to Calculate Area of rectangle
*/
import java.util.Scanner;
class AreaOfRectangle {
public static void main (String[] args)
{
Scanner scanner = new Scanner(System.in);
System.out.println("Enter the length of Rectangle:");
double length = scanner.nextDouble();
System.out.println("Enter the width of Rectangle:");
double width = scanner.nextDouble();
//Area = length*width;
double area = length*width;
System.out.println("Area of Rectangle is:"+area);
}
}
Answered by
6
Explanation:
JAI SHREE RAM
HOPE IT HELPS
Attachments:
Similar questions
Science,
4 months ago
Math,
4 months ago
Computer Science,
4 months ago
Computer Science,
9 months ago
Geography,
9 months ago