Print Series Of Numbers Using Recursion in CPP

  1. Home
  2. Tutorials
  3. CPP
  4. CPP Programs
  5. Recursion
  6. Program

Source Code

#include <iostream>

using namespace std;

int printSeries ( int );

int main(int argc, char** argv) {

int a;  // variable declaration for input
    // Taking input in variables
    cout<<"Enter First Number : ";
    //function call

return 0;

int printSeries ( int x) {
    if(x == 1)   //base condition
        return 1;
        return printSeries(x);  // recursive call


print numbers series in c++ using recursion


In this program example first of all a function is declared of name prnitSeries. Then in function defination ( after main function ) call to same method is palce in its own body.  This call is called recursive call. A base condition is also set in function body which determine the end of recursion.

Login to TRACK of Comments.