This allows the reader to find the return statement easily. Here is a subroutine that uses this nextN function. The value of startingValue must be a positive integer. One of the terms in the sequence. Here are a few more examples of functions.
Functions can return values of any type at all.
Here's a function whose return value is of type boolean . Returns true if N is a prime number. If so, we know N is not prime. If we get to this point, N must be prime. This function has a String as parameter.