Why is there a segmentation fault in the code?

question ) https://hack.codingblocks.com/app/practice/1/109/problem

my answer ) https://ide.codingblocks.com/s/247426

hello @N4i9kita
image
your base case (i.e line 6) should be the very first line of ur recursive function.
put statement in line 6 before line 5.

hello @aman212yadav . I did the change . Still happening

image

it should be either i+1 or ++i.

read difference between pre-increment and post-increment.

Oh yeah . Got it. Thanks.