There are two forms of recursion,
-
Tail Recursion : The return value is calculated as a combination of the value of current subroutine and the return value of the next call. Example,
int factorial(int a) { if(a==0) return 1; else return a * factorial( a-1 );
}