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
8
The given code 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:
![](https://hi-static.z-dn.net/files/d33/7ae363e980d523c63c63d55f0b2a0e96.jpg)
![](https://hi-static.z-dn.net/files/d14/b4210289497fd444edec43ea3d79e990.jpg)
Answered by
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