Menu Bar

Horizontal Scrollable Menu

ads

Search This Blog

Java Area of Rectangle

  Program to calculate the area of ​​the rectangle

The area of ​​a rectangle is the amount of space occupied by the rectangle. A rectangle can be defined as a plane shape that has two adjacent sides of length. The 4 angles present in the rectangle are also equal. A rectangle can be divided into 4 equal squares. Each internal angle in a rectangle measures 90 degrees.
The area of ​​a rectangle is the number of square units to fill a rectangle completely.

 

Source code:

import java.io.*;
import java.util.*;
class Area
{
public static void main(String []args)
{
Scanner ob=new Scanner(System.in);
int l,h;
l=ob.nextInt();
h=ob.nextInt();
System.out.println("enter value l and h");
int Rec=l*h;
System.out.println("Area of rectangle:"+Rec);
}
}

No comments:

ads3