Showing posts with label what is recursion in c. Show all posts
Showing posts with label what is recursion in c. Show all posts

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++