where i am wrong i also have attached recursion tree.
my aim is to print all this but i am getting segmentation fault.
ideon - getting runtime error and one output(aaa)
when n=3;
Segmentation fault
Hey @officialharshit1996
U forgot to add a return statement in base case
if(i==n)
{
inp[i]=’\0’;
cout<<inp<<endl;
return;//added this
}
Also ,
try to find the pattern in output
for
1->2
2->3
3->5
4->8…
If this resolves ur query then please mark it as resolved 
after correcting mistake that u pointed out, i am not able to pass any case
please share ur code in IDE? And whatis the issue exaclty? TLE or WA?
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
