• admin@embedclogic.com

Function Calling In C

Function Calling

Function calling is the component of the function used to call any user or library defined function inside main.

Syntax

return_type function_name(input1_dataType,input2_dataType);

Types of Function Calling

Function calling has several types on the basis of input and output parameter –

— Function call with no input and no output

— Function call with input but no output

— Function call with no input but some output

— Function call with some Input and some output

Function call with no input and no output

— return_type    : void 

— input1,input2 : void 

Syntax

function_name();

Example:

Program for addition of two unsigned number by function calling
Function call with some input but no output

return_type    : void 

input1 , input2 : variable or some constant value

Syntax

  function_name(input1,input2,…..inputn);

Example

Program to find 3 digit Armstrong Number by function calling
Function Calling With no input but returns some output 

return_type    : some data type

input1,input2 : No input param

Syntax

  result=function_name();

Example:

main function with no input parameter and an integer return.

Function call with no input and no output

return_type: any data type

input1,input2 : value

Syntax

function_name(input1,input2);

Example:

Program for addition of two unsigned number by function calling