A function is a block of code that has a name and a block of statements that are executed when the function is called. To perform repetitive tasks, Custom functions are used. Functions are declared by first declaring the function type followed by function name and in paranthesis any parameters being passed to function.


type function_name(parameters)

{} curly braces

These curly braces are used to define beginning and end of a function block and statements. An opening curly brace { must always be followed by a closing curly brace }.

; semicolon

A semicolon must be used to end a statement and separate elements of the program.

/*…….*/ block comments

Block comments or multi line comments are areas of text ignored by the program and are generally used for large text descriptions of codes and  to write comments to help understand the programmer and users.

// line comments

Single line comments begin with // and end with the next line of code. These are also ignored by the program and does not occupy any memory space.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s