Home Show/Hide Menu
Bluej Programs
➜ Test-paper-IT-10
➜ Suggestion Paper, Class-12

bluej Programs

1.Write a Program to find out the area of a rectangle

import java.util.*;
class area_rectangle
{
    void main()
    {
        Scanner sc=new Scanner(System.in);
        int l,b,a;
        System.out.println("Enter the length and breadth of a rectangle:");
        l=sc.nextInt();
        b=sc.nextInt();
        a=l*b;
        System.out.println("Area of the rectangle:"+a);
    }
}


Output:
Enter the length and breadth of a rectangle:
23
10
Area of the rectangle:230
 
ADVERTISEMENT