what is wrong with this??it works fine with 9 digit number but as soon as number is increased to 10 digit it is not working
Chewbecca and number
There is an error in line no 9 , where for recursion u just need to compare only the 1st and 2nd elements for comparison and when you are calling the recursive function, try using the recursive condition for A+1, instead of A.