Computer Science, asked by feelixytoysreview, 4 days ago

write an algorithm to find the perimeter of an object

Answers

Answered by mooncakes27
0

Answer:

Perimeter = AB + BC + CD + DA => L + B + L + B => 2 * (L + B)

Explanation:

Algorithm to Calculate Perimeter of Rectangle

For calculating the perimeter of a rectangle we will need its length and its breadth. We have two variables, L and B, that store the length and breadth respectively.

Length of rectangle = L

Breadth of rectangle = B

algorithm to calculate perimeter of rectangle

Now in the rectangle ABCD given above, we can see that sides AB and CD denote the length, whereas sides BC and DA denote the breadth. Thus we can say that,

AB = L and CD = L BC = B and DA = B

So now we need to find the length of the boundary of this closed figure (rectangle ABCD) to find its perimeter. Thus the perimeter will be the sum of all sides of the rectangle, i.e.

Perimeter = AB + BC + CD + DA => L + B + L + B => 2 * (L + B)

Hence we can say that the perimeter of a rectangle can be calculated by the formula twice the sum of length and breadth.

Similar questions