132k views
0 votes
Find the perimeter of a rectangle

Input: two numbers l and b
Output: result of l*b

Algorithm steps
Step 1: start
Step 2: declares variables l,b,result
Step 3: Write "Enter the length of the rectangle"
Step 4: read l
Step 5: Write "Enter the breadth of the rectangle"
Step 4: read b
Step 5: calculate perimeter of rectangle result = 2(l+b)
Step 6: Display "The perimeter of the rectangle is" +result
Step 7: stop


User PrzemG
by
7.4k points

1 Answer

3 votes

Final answer:

The given algorithm calculates the perimeter of a rectangle using the length and breadth of the rectangle. It prompts the user to enter the length and breadth, calculates the perimeter using the formula 2(l + b), and displays the result.

Step-by-step explanation:

The given algorithm calculates the perimeter of a rectangle using the length and breadth of the rectangle. It starts by declaring variables for length, breadth, and result. Then, it prompts the user to enter the length and breadth of the rectangle. After reading the values, it calculates the perimeter using the formula 2(l + b) and stores the result in the 'result' variable. Finally, it displays the calculated perimeter to the user.

Learn more about Perimeter of a rectangle

User Trueunlessfalse
by
7.9k points