Hello,
sir i want to know when not to use recursion.
Wrong question.
You should be asking "When would I use recursion?"
Recursion should be used only in moderation, and only when an exit condition can be clearly defined, so as to avoid infinite recursion. Study the 'quicksort' algorithm for an example of how to use recursion properly. This is a good example because the same sort can also be written iteratively. Both have their uses.