Example: SUB ... Procedure and CALL statement

DECLARE SUB add (a,b)
CLS
INPUT "Enter first number"; x
INPUT "Enter second number"; y
CALL add (x,y)
END

SUB add (a,b)
c = a+b
PRINT "The sum is ";c
END
  • Here, 'add' is the name of sub procedure. a and b are parameters.
  • Here CALL statement calls the sub module or sub procedure 'add' with the answer. x and y are arguments.

Share :

Twitter
Back To Top

facebook main

counter

Powered by Blogger.