please tell me why i am getting this error
Help me out i this problem as karthik has written code of diffeent problem
Hey @shivammishra20121999
Sorry I pasted wrong code there,u should have told me instead of opening new doubts https://ide.codingblocks.com/s/354798
Updated ur code and mentioned the changes in comments
Mentioned the places where there should be some statement or is incorrect.
Now its prinitng so try to debug logically 
No problem 
share ur code again 
Bro what problem are u facing ,have u even read my comments.
Its prinitng on my side
I just rectified the places due to which u are stucking into infinite loop.
You still have to debug logically.
I tried for “aba”