Basics

Java Program to Calculate Area of Rectangle

Area of Rectangle

This posts shows the Java Program to calculate the Area of Rectangle.

/**
 * @(#)Circle.java
 * @program :  Java Program to calculate
 * @web		:  ICSE JAVA MADE EASY
 * @author    :  Arun Kumar Murmu
 * @version   : 1.00
 */

import java.io.*;
import java.util.*;

public class Rectangle 
{
    public static void main(String arg[ ]) 
    {
      Scanner sc = new Scanner(System.in);
      int l, b, area;
      System.out.println("Enter length = ");
      l = sc.nextInt();
      System.out.println("Enter breadth = ");
      b = sc.nextInt();
      area = l * b;
      System.out.println("Area of Rectangle = "+area);
    }
}

Here is the Output of the above Program :

Enter length = 
4
Enter breadth = 
5
Area of Rectangle = 20

Process completed.

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

To Top