Mr.why?
asked

Expert
Kelish Rai answered
To master the breaking conditions in recursion, you need to understand these two things first:
figuring out when the function should stop (usually with an
ifcheck),and making sure it actually stops — usually with a
return.
After this, you need to ask yourself "what's the smallest or simplest case where I don’t need more recursion?". This will serve as your base case. Then make sure the function hits that eventually.
It gets easier the more you practice. Try simple stuff like factorial or summing numbers — they help you build that instinct.
C
This question was asked as part of the Learn Recursion With C course.
Our Experts
Sudip BhandariHead of Growth/Marketing
Apekchhya ShresthaSenior Product Manager
Kelish RaiTechnical Content Writer
Abhilekh GautamSystem Engineer
Palistha SinghTechnical Content Writer
Sarthak BaralSenior Content Editor
Saujanya Poudel
Abhay Jajodia
Nisha SharmaTechnical Content Writer
Udayan ShakyaTechnical Content Writer