Online Programming tutorials…..

Function Call Sequence

In C, function can be called from any function’s body. One function can call another function and the called function can still call another function and so on. There is no limit of this type of call sequence. Let us see following conceptual example: void computer ( ); void cpu ( ); void memory ( [...]

Call by Value and Call by Reference

When a function is called, parameters in the called function take the value of corresponding arguments supplied by the calling function. For example, if we have a function add ( ) defined as: int add (int x, int y) { int sum; sum = x+y; return (sum); } The call to this function cab be [...]

Function passing arguments and returning value

In this type of function call, the called function receives the value through parameters from the calling function and sends back the result to the calling function. The general format of this type of function is as follows: return_type function_name (type1 arg1, type2 arg2…); The use of this type of function is illustrated by following [...]

Function passing arguments and returning no value

In this type of function call, the called function receives the value through parameters from the calling function, but result is not sent back to the calling function. Instead it is used in called function. The general format of this type of function is as follows: void  function_name (type1 arg1, type arg2, ….); The use [...]

Function passing no arguments and returning value

In this type of function call, the called function does not receive the value of parameters from the calling function. But the calculated result is sent back to the calling function. The general format of this type of function is as follows: return_type function_name (void); This type of function usage can be illustrated by following [...]

Function passing no arguments and returning no value

In this type of function call, the called function receives no value from the calling function and does not sends any result to the calling function. The calculated result is used in the called function. The general format of this type of function is as follow: void function_name(void); This type of function usage can be [...]

Function Prototype

Function prototype is actually the function header which is specified before the function call is made. The function prototype provides the way of function declaration before they are used. This process of providing function prototype is called prototype declaration or just function declaration. The declaration of function prototype is as follows: return_type function_name (parameter list); [...]

Function Call

A function is an inactive entity, which becomes active when a call is made to the function. A function call is an expression of the form   function_name(parameter list); Where function_name is the name of the function called and parameter list is a comma separated list of expression that constitute the parameters to the function. [...]

Function Definition

The function definition introduces a new function by declaring the type of value it returns, its parameters and their types and specifying the statement that are executed when the function is called. The function definition has the following general form: return_type function_name(parameter_list) { declaration; statements; } return_type refers to a value returned by the function [...]

Functions

The function is a group of statement in a single logical unit to perform some specific task is called function.  The C program is usually made up of many small functions, each performing a particular task, rather than one single large main ( ) function. Once a function has been designed, its result can be [...]

Previous Posts