C++ Recursion Function
Recursion (recursive) function is such function which call itself again and again. A recursion function call takes within the same function. The condition where the recursive function terminates is called the base case.
Syntax:

C++ Recursion Example
#include <iostream>
using namespace std;
int factorial(int);
int main()
{
int n,fact;
cout<<"Enter a number to find factorial: ";
cin >> n;
fact=factorial(n);
cout << "Factorial of " << n <<" = " << fact;
return 0;
}
int factorial(int n)
{
if (n > 1)
{
return n*factorial(n-1);
}
else
{
return 1;
}
}
Enter a number to find factorial: 5 Factorial of 5= 120