printf("% \ ",res)return int fibonacci(int nif = return else if = return else return fibonacci( - fibonacci( - )output enter the number of terms fibonacci series types of recursion recursion is technique that breaks problem into one or more sub-problems that are similar to the original problem any recursive function can be characterized based onwhether the function calls itself directly or indirectly (direct or indirect recursion)int func (int nwhether any operation is pending at each recursive call (tailif ( = recursive or not)and return nthe structure of the calling pattern (linear or tree-recursiveelse return (func ( - ))figure direct recursion int funcl (int nif ( = return nelse return func ( )int func (int xreturn func ( - )figure indirect recursion int fact(int nif ( = return else return ( fact( - ))figure non-tail recursion in this sectionwe will read about all these types of recursions direct recursion function is said to be directly recursiveif it explicitly calls itself for exampleconsider the code shown in fig herethe function func(calls itself for all positive values of nso it is said to be directly recursive function indirect recursion function is said to be indirectly recursive if it contains call to another function which ultimately calls it look at the functions given below these two functions are indirectly recursive as they both call each other (fig tail recursion recursive function is said to be tail recursive if no operations are pending to be performed when the recursive function returns to its caller when the called function returnsthe returned value is immediately returned from the calling function tail recursive functions are highly desirable because they are much more efficient to use as the amount of information that has to be stored on the system stack is independent of the number of recursive calls in fig the factorial function that we have written is nontail-recursive functionbecause there is pending operation of multiplication to be performed on return from each recursive call