Computer Science, asked by ujjayatisikder, 4 months ago

Write a java program to find the area and perimeter of the rectangle where length is 100cm and breadth is 75cm.
Also don't use string.args​

Answers

Answered by anindyaadhikari13
8

\texttt{\textsf{\large{\underline{Solution}:}}}

The given c‎ode is written in Java.

public class RectArea{

   public static void main(){

       int length=100;

       int breadth=75;

       int perimeter=2*(length+breadth);

       int area=length*breadth;

       System.out.println("Length: "+length+" cm.");

       System.out.println("Breadth: "+breadth+" cm.");

       System.out.println("Perimeter: "+perimeter+" cm.");

       System.out.println("Area: "+area+" sq cm.");

   }

}

Logic:

  • Initialise length = 100, breadth = 75.
  • Calculate area and perimeter using formula - A=lb and P=2(l+b).

See the attachments for output.

Attachments:
Answered by Anonymous
1

Answer:

Area=l.b

= 5×100cm×75cm

=37500cm^2  

Perimeter= 2(l+b)  

=2(5×100+75)cm  

=1150cm  

Hope this helps

Explanation:

Pls vote for brainliest

Similar questions