V. The length of a rectangular field is 300 m and width is 200 m. Write a program in java to find the
length of the wire required to fence it around 4 times.[Hint:-perimeter=2*(l+b)]
Answers
Answered by
3
Answer:
The solution is given below.
Explanation:
class Fencing // declaring class name.
{
public static void main(String args[])
{
int length=300, breadth=200, perimeter =0, WireReq=0; /* declaring and initialising the variables*/
perimeter = 2* (l+b); //calculating the perimeter of field.
WireReq = 4* perimeter; //calculating the wire required
System.out.println("The wire required is "+ Wirereq +"m");
}
}
PLEASE MARK ME THE BRAINLIEST
Similar questions