Wednesday, 4 February 2015

Recursion in C++

Structure of the Problem Requirements 

A Recursive function is that which call itself again and again until base case . Base case is that condition in which our recursion function terminate.

Source Code

#include<iostream>
using namespace std;
void recursion(int lep)
{
int b=6;
if(lep>b)
return;
else{
cout<<" LEP Recursion Tutorial # : "<<lep<<endl;
recursion(lep=lep+1);
}
}
int main(){
int start =1;
recursion(start);
return 0;
}

Output of the Program

Recursion in C++

Share it Please
asad

About Author!

Asad Niazi is Software Engineer , Programmer, Web Developers and a young mentor of Tech Solutions Desk and Blogging Solutions . Asad Love to writes about Technology, Programming, Blogging and make money online.

0 comments:

Post a Comment