Java Program For Area Of Rectangle

Ram Pothuraju
//File name --> Rectangle.java

class Rectangle

{
    public static void main(String args[])
    {
        int width=15,height=10;
        int area=width*height;
       
        System.out.println("Area of Rectangle having width "+width+" and height "+height+" is:"+area);
       
    }
}


OUTPUT

javac Rectangle.java

java Rectangle
Area of Rectangle having width 15 and height 10 is:150

Post a Comment

0Comments

Post a Comment (0)