Example: FUNCTION Procedure

The Syntax of FUNCTION Procedure is:
            FUNCTION Name (parameters)
                      Statements
                      Name=expression
            END FUNCTION

Example:
A program to find area of rectangle
DECLARE FUNCTION area (l, b)
CLS
PRINT area(l, b)
END

FUNCTION area (l, b)
INPUT "Enter length of rectangle"; l
INPUT "Enter breadth of rectangle"; b
a = l * b
area = a
END FUNCTION

Share :

Twitter
Back To Top

facebook main

counter

Powered by Blogger.