0% found this document useful (0 votes)
24 views1 page

Algo Function Procedure

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

Algo Function Procedure

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

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

You might also like