google.com, pub-8786015629279405, DIRECT, f08c47fec0942fa0 Write a program to find the area, perimeter and diagonal of a rectangle.

Write a program to find the area, perimeter and diagonal of a rectangle.

0


public class ashish
{
        public static void main(String args[])
        {
                int l,b,ar,p;
                double d;
                l=24;
                b=10;
                ar=1*b;
                p=2*(l+b);
                d=Math.sqrt(l*l+b*b);
                System.out.println("The area of two rectangle="+ar);
                System.out.println("The perimeter of rectangle="+p);
                System.out.println("The diagonal of rectangle="+d);
        }
}
Expected Output:
The area of two rectangle=10
The perimeter of rectangle=68

The diagonal of rectangle=26.0

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

Thank you for your interest 😊

We will back shortly after reviewing...

Thank you for your interest 😊

We will back shortly after reviewing...

Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !
To Top