What is the error in my code?
Please tell as ssoon as possible.
Recursion conversion of string to integers
Hi @dktrip.
The base case you are using is when str.length-1==i and in the parameter you are passing substring of size 1 so your base case is active in first call itself… Like when you pass str1 for the first time the length of str1 is 1 and in that case the base case will be active and the program will end after giving output n which is zero
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.