A Function Call itself is known as Recursive Function. And, this technique is known as recursion in c++.

If there is no base case in the recursive function, the recursive function will continue to repeat continuously.

recursion in cpp

The syntax to declare a Recursive Function in c++ is :

 void recursionfunction()
     ... .. ...
     recursionfunction(); // Recursive Call
     ... .. ...

Example of Factorial of a Number Using Recursion :

using namespace std;
int main()
  int factorial(int);
  int fact,value;
  cout<<"Enter any number: ";
  fact=factorial(value); // Function Call
  cout<<"Factorial of a number is: "<<fact<<endl;
  return 0;
int factorial(int n)
      return(1);  /*Terminating condition*/


Enter any number: 5 Factorial of a number is: 120

Also read this :- Function in C++

Advantages of C++ Recursion :

It makes our code shorter and cleaner.

Recursion is required in problems concerning data structures and advanced algorithms, such as Graph and Tree Traversal.

Disadvantages of C++ Recursion :

It takes a lot of stack space compared to an iterative program.

It uses more processor time.

It can be more difficult to debug compared to an equivalent iterative program.