web analytics

C Programming

What is recursion?

Recursion : Recursion is a special case where a function calls itself. A very simple example of recursion is presented below, main(){ printf(“This is an example of recursion.n”); main(); } When executed this program will produce an output which is something like this, This is an example of recursion. This is an example of recursion. This …

What is recursion? Read More »

What is nesting of functions?

Nesting of functions : In C, each function can contain one or more than one function in it. There is no limit as to how deeply functions can be nested. Consider the following example, function main(){ function01(); }function function01(){ function02(); }function function02(){ //do something more here. } In the above example, The main() function contains function01(), the function01() contains function02 and so on. This …

What is nesting of functions? Read More »

What are parameters in functions?

Function Parameter: Function parameters are variables of a function that we can use to send data to the function. Parameters are declared as follows:function function_name(int var_a, float var_another){//do something here}Here in the above function var_a and var_another are two parameters of the function called function_name. When making a call to that function as followsfunction_name(5, 5.5);we are …

What are parameters in functions? Read More »

How to declare a function in C or C Plus Plus?

Function declaration : The program or a function that called a function is referred to as the calling function or calling program. The calling program should declare any function that is to be used later in the program. This is known as the function declaration.  A function declaration consists of four parts. They are, Function type …

How to declare a function in C or C Plus Plus? Read More »

Explain or Describe function definition.

Function Definition:  The function definition is an independent program module that is specially written to implement to the requirements of the function. A function definition, also known as function implementation shall include the following elements Function name Function type List of parameters Local variable declarations Function statements A return statement All the six elements are …

Explain or Describe function definition. Read More »

RSS
Follow by Email
Scroll to Top