#include <iostream> using namespace std; void print_fibo(int n, int a=0,int b=1) { if(n>0) { cout<<a<<"\t"; int sum = a+b; a=b; b=sum; print_fibo(n-1,a,b); } } main() { print_fibo(10); }
Love Truth Service
#include <iostream> using namespace std; void print_fibo(int n, int a=0,int b=1) { if(n>0) { cout<<a<<"\t"; int sum = a+b; a=b; b=sum; print_fibo(n-1,a,b); } } main() { print_fibo(10); }