• + 0 comments

    Its giving a runtime error because most probably, the recursive calls are too much even for even a much smaller value of 'n' like 40 or 50. Hence, at runtime, the stack will get fully occupied (i.e., Stack Overflow) which results in inability of the function to call itself again. From my point of view, i think this the problem.