0% found this document useful (0 votes)
32 views

Functions: by Jeannie Francis

The document discusses functions in programming. It defines a function as using the Function statement to declare a name, parameters, and body. A function can return a value using the Return statement or by assigning the value to the function name. The document also explains that a recursive function is one that calls itself, allowing a process to repeat itself through self-reference. An example program prints a table using a function.

Uploaded by

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

Functions: by Jeannie Francis

The document discusses functions in programming. It defines a function as using the Function statement to declare a name, parameters, and body. A function can return a value using the Return statement or by assigning the value to the function name. The document also explains that a recursive function is one that calls itself, allowing a process to repeat itself through self-reference. An example program prints a table using a function.

Uploaded by

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

FUNCTIONS

By Jeannie francis

FUNCTIONS???
The Function statement is used to declare the name, parameter and the body of a function. The syntax
for the Function statement is:
Syntax:[Modifiers] Function FunctionName [(ParameterList)] As ReturnType [Statements] End Function

Terms
Modifiers: specify the access level of the function; possible values are: Public, Private, Protected,
Friend, Protected Friend and information regarding overloading, overriding, sharing, and shadowing.
FunctionName: indicates the name of the function
ParameterList: specifies the list of the parameters
ReturnType: specifies the data type of the variable the function returns

Returning a value

A FUNCTION CAN RETURN A VALUE TO THE CALLING CODE IN TWO WAYS:


1.BY USING THE RETURN STATEMENT
2.BY ASSIGNING THE VALUE TO THE FUNCTION NAME

RECURSIVE FUNCTION
A function can call itself. This is known as recursion. Recursionis a
programming technique that allows the programmer to express
operations in terms of themselves. In cb.net, this takes the form of
a functionthat calls itself. A useful way to think ofrecursive
functionsis to imagine them as a process being performed where
one of the instructions is to "repeat the process".

PROGRAM
1.Program for table:-

You might also like