Answers for "Java program which intakes width and height of a Rectangle and there by print its area"

3

Java program to calculate area of rectangle

import java.util.Scanner;
public class RectangleArea
{
   public static void main(String[] args)
   {
      Scanner sc = new Scanner(System.in);
      System.out.println("Please enter length of rectangle: ");
      double length = sc.nextDouble();
      System.out.println("Please enter width of rectangle: ");
      double width = sc.nextDouble();
      double area = length * width;
      System.out.println("Area of rectangle is: " + area);
      sc.close();
   }
}
Posted by: Guest on November-10-2020

Code answers related to "Java program which intakes width and height of a Rectangle and there by print its area"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language