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++ Recursion in C++](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQSad_nyzpmxpHT_g08opTa9mW7naAhIfIB8i9MlDgGGnqu2G3e1Tfz2oFAasQub6sRuQXfrEwkTxj9MeQNEPaacX-0qC6gSGu2EQGgNx1Q_7K7wldpyYh1e_3X-Zgb8Zk6fIdJYa0vfg/s1600/recursion.png)
0 comments:
Post a Comment