0% found this document useful (0 votes)
20 views2 pages

Rectangle Area and Perimeter Algorithm

The document outlines two algorithms for calculating geometric properties of a rectangle. The first algorithm computes the area by multiplying length and breadth, while the second calculates the perimeter using the formula P = 2 * (L + B). Both algorithms include steps for initialization, input, computation, and output.

Uploaded by

aishnarahul
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views2 pages

Rectangle Area and Perimeter Algorithm

The document outlines two algorithms for calculating geometric properties of a rectangle. The first algorithm computes the area by multiplying length and breadth, while the second calculates the perimeter using the formula P = 2 * (L + B). Both algorithms include steps for initialization, input, computation, and output.

Uploaded by

aishnarahul
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Algorithm Programming

Q=Write an algorithm to display area of a


rectangle?
Step 1: Start
Step 2: Initialize the variables LENGTH (L),
BREADTH (B) and AREA (A) as integers.
Step 3: Input the variable LENGTH (L).
Step 4: Input the variable BREADTH (B).
Step 5: Compute the AREA (A) as A = L x B.
Step 6: Print the area as AREA (A).
Step 7: Stop
Q=Write an algorithm to display perimeter
of rectangle?
Step 1: Start
Step 2: Initialize the variables LENGTH (L),
PERIMETER (P) and BREADTH (B) as
integers.
Step 3: Input the variable LENGTH (L).
Step 4: Input the variable BREADTH (B).
Step 5: Compute the Perimeter as P = 2 *
(L + B).
Step 6: Print the perimeter as PERIMETER
(P).
Step 7: Stop

You might also like