Computer Science, asked by heartlessshe, 19 days ago

java program to print perimeter of a rectangle

Answers

Answered by VivanTopper
1

Answer:

public class Main.

{

public static void main (String args[])

{ float a ,b, c, d, perimeter;

a=c= 5;

b=d=4;

perimeter = 2*(a+b);

System.out.println("Perimeter of Rectangle is: "+perimeter);

}

}

Explanation:

pls mark me brainlist

Answered by manya8127tiwari
0

Answer:

public class Main  

{  

  public static void main (String args[])  

   {      float a ,b, c, d, perimeter;  

                   a=c= 5;  

                   b=d=4;  

                   perimeter  = 2*(a+b);  

           System.out.println("Perimeter of Rectangle is: "+perimeter);  

   }}  

Output:

Perimeter of Rectangle is: 18.0

Explanation:

A rectangle has four sides in which sides opposite to each other are equal. The perimeter of the rectangle is the area around its outside.

Suppose a, b, c, d are the four sides of rectangle.

a=c and b=d

Perimeter Of Rectangle= a+ b+ c+ d= a+ b+ a+ b= 2(a + b).

Similar questions