Program To calculate area of a 2d shape
FUNCTION calcAreaRectangle (w : INTEGER, h : INTEGER) RETURNS INTEGER
DECLARE Area : INTEGER
Area ← w * h
RETURN Area
ENDFUNCTION
FUNCTION areaOfCircle(r : REAL) RETURNS REAL
CONSTANT pi ← 3.14
DECLARE Area : REAL
Area = pi * r * r
RETURN Area
ENDFUNCTION
result ← calcAreaRectangle(4, 5)
OUTPUT “The Area of a rectangle (w=4 & h=5) is: ” , result
cResult ← areaOfCircle(75.5)
OUTPUT “The Area of a circle (r=75.5) is: ” , cResult