Computer Science, asked by ayushhi, 8 months ago

Algorithm to find area and perimeter of a rectangle

Answers

Answered by Chandra1972
3

Explanation:

Algorithm

START

In Function int area(int a, int b)

Step 1 -> Declare an integer ‘area’ and store a * b in it

Step 2 -> Return area.

In Function int perimeter(int a, int b)

Step 1-> Declare an integer ‘perimeter’ and store 2*(a + b) in it

Step 2-> Return perimeter

In int main()

Step 1 -> Declare two integers ‘length’, ‘breadth’

Step 2 -> Print area(length,breadth)

Step 3 -> Print perimeter(length, breadth);

STOP

Similar questions