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