Algorithm to Calculate Area of Shapes
Subject: PPS (Programming for Problem Solving)
Contributed By: Sanjay
Created At: February 3, 2025
Question:
Write an algorithm to Calculate Area of Different Shapes
Explanation Video:

Explanation:
Algorithm:
Start.
Read the shape (Square, Rectangle, Circle, Triangle).
Based on the shape:
Square: Read side s, calculate area = s * s.
Rectangle: Read length l and breadth b, calculate area = l * b.
Circle: Read radius r, calculate area = 3.14 * r * r.
Triangle: Read base b and height h, calculate area = 0.5 * b * h.
Print the area.
Stop.