> Online tutorial : function definition in c
Showing posts with label function definition in c. Show all posts
Showing posts with label function definition in c. Show all posts

function definition in c

Element of user defined function:

1.function definition

2.function call

3.function declaration


Defintion of function

A function definition ,also known as function implememtation shall include the following elements

1.function name

2.function type


3.list of parameter

4.local variable declaration

5.function statement

6.a return type

Syntax

Function type function_type(parameter list)

{

Local variable declaration;

Executable statement1;

Executable statement2;

Return statement;

}

Example:

void add(int a,int b)
{
int c;
return 0;
}


for above the statement

void          - return type
add          -function name
int a,int b  -parameter