This function name will be FN and any legal variable name (1 or 2 characters long) and is followed by the parameter in parenthesis. This parameter will be substituted into the formula wherever the parameter variable is located.
10 DEF FN A(X) = 2 * ( 6 - X / 3 ) 20 PRINT FN A(12) ^ ^ | | | 12 is inserted where +------------+ X is in the formula
When RUN, this program displays "4" as the answer. The result of the formula is calculated every time the FN statement is used, using the value given in the parentheses.
The formula for generating a number between 0 and X is:
N = RND(1) * XTo generate a number between X and Y, use
N = RND(1) * (Y - X) + X