My code is giving segmentation fault in the prime visit problem

hello @mukuuu
ur array arr size is 1000 0000 , so maximum index u can access is 1000 0000 - 1 becuase of 0 based indexing.


thats why here u should use < in place of <=

Hello @aman212yadav

Please Have a look on the code now. It is still giving segmentation fault.

declare arr and c_sum as a global array.

reason -> global scope has higher memory capacity then function scope