Function and recursion Exercises and solution

Function and recursion  Exercises and solution  in c program : 


Now that you should have learned about variables, loops, and conditional statements it is time to learn about functions. You should have an idea of their uses as we have already used them and defined one in the guise of main. Getchar is another example of a function. In general, functions are blocks of code that perform a number of pre-defined commands to accomplish something productive. You can either use the built-in library functions or you can create your own functions. 







Functions that a programmer writes will generally require a prototype. Just like a blueprint, the prototype gives basic structural information: it tells the compiler what the function will return, what the function will be called, as well as what arguments the function can be passed. When I say that the function returns a value, I mean that the function can be used in the same manner as a variable would be. For example, a variable can be set equal to a function that returns a value between zero and four. 






All the programming languages in the modern world can be used to solve many complex problems using this recursive function. Although many people do not understand this method because they do not use this method. Recursive Function means a function when calling itself in itself. This process continues as long as the function returns no number for a specific parameter.



Required  knowledge : 

for loop string 

No comments

Powered by Blogger.