Solution:NIIT/GNIIT Sonugiri0032@gmail.com

Wednesday, January 06, 2016

Recursion in C++

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:

0 comments:

GNIITSOLUTION GNIIT SOLUTION. Powered by Blogger.

Translate

Blog Archive

Unordered List